Class 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 Detail

      • JAASUserProvider

        public JAASUserProvider()
    • Method Detail

      • getCurrentUser

        public FeatureUser getCurrentUser()
        Description copied from interface: UserProvider
        Return a FeatureUser instance representing the current user. This method should return null if the implementation is unable to determine the user.
        Specified by:
        getCurrentUser in interface UserProvider
        Returns:
        current user or null
      • isFeatureAdmin

        protected boolean isFeatureAdmin​(Principal principal)
        Checks if the supplied user is a feature admin. The default implementation always returns false. Users can overwrite this method to implement a different behavior.
        Parameters:
        principal - The principal
        Returns:
        true for feature admins, false otherwise