Package org.togglz.core.user.jaas
Class JAASUserProvider
java.lang.Object
org.togglz.core.user.jaas.JAASUserProvider
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionReturn aFeatureUserinstance representing the current user.protected booleanisFeatureAdmin(Principal principal) Checks if the supplied user is a feature admin.
-
Constructor Details
-
JAASUserProvider
public JAASUserProvider()
-
-
Method Details
-
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
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
-