users@glassfish.java.net

Dynamic Groups and Roles depending of the current object

From: Miroslav Nachev <miro_at_space-comm.com>
Date: Mon, 07 May 2007 17:49:53 +0300
Hi,

I need to have dynamic set of groups and roles for each user depending of the selected (current) object. This is similar to the real world where one person have different permissions depending on that where is: own company, shop, cinema, partner company, home, etc.
When I read the rules for GlassFish AS I see that the groups are loaded statically only at Login (authenticateUser()) procedure (method):
    String[] grpList;
    // populate grpList with the set of groups to which
    // _username belongs in this realm, if any
    return commitUserAuthentication(_username, _password, _currentRealm, grpList);

Is it possible to do that using custom realm extending the base class AppservRealm?

Also from where can I found some examples for that and where is the documentation which describe how to configure my custom Login and Realm? Which XML or property files to use and how?
I am reading 819–3672–05 ("Sun Java SystemApplication Server 9.1 Developer'sGuide") but can not find such information.


Regards,
Miro.