Package org.togglz.core.user.jaas
Class JAASUserProvider
- java.lang.Object
-
- org.togglz.core.user.jaas.JAASUserProvider
-
- All Implemented Interfaces:
UserProvider
public class JAASUserProvider extends Object implements UserProvider
This implementation supports looking up the current user the JAAS AccessControlContext. The class currently doesn't support determining whether a user is a feature admin and therefore always sets it to false. Overriding#isFeatureAdmin(String)allows to change the default behavior.- Author:
- Christian Kaltepoth
-
-
Constructor Summary
Constructors Constructor Description JAASUserProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FeatureUsergetCurrentUser()Return aFeatureUserinstance representing the current user.protected booleanisFeatureAdmin(Principal principal)Checks if the supplied user is a feature admin.
-
-
-
Method Detail
-
getCurrentUser
public FeatureUser getCurrentUser()
Description copied from interface:UserProviderReturn aFeatureUserinstance representing the current user. This method should returnnullif the implementation is unable to determine the user.- Specified by:
getCurrentUserin interfaceUserProvider- Returns:
- current user or
null
-
isFeatureAdmin
protected boolean isFeatureAdmin(Principal principal)
Checks if the supplied user is a feature admin. The default implementation always returnsfalse. Users can overwrite this method to implement a different behavior.- Parameters:
principal- The principal- Returns:
truefor feature admins,falseotherwise
-
-