org.apache.sling.jackrabbit.usermanager.impl
Class AuthorizablePrivilegesInfoImpl

java.lang.Object
  extended by org.apache.sling.jackrabbit.usermanager.impl.AuthorizablePrivilegesInfoImpl
All Implemented Interfaces:
AuthorizablePrivilegesInfo

public class AuthorizablePrivilegesInfoImpl
extends Object
implements AuthorizablePrivilegesInfo

Helper class to assist in the usage of access control of users/groups from scripts. The default access control policy defined by this provider has the following characteristics:


Constructor Summary
AuthorizablePrivilegesInfoImpl()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext)
          Called by SCR to activate the component.
 boolean canAddGroup(javax.jcr.Session jcrSession)
          Checks whether the current user has been granted privileges to add a new group.
 boolean canAddUser(javax.jcr.Session jcrSession)
          Checks whether the current user has been granted privileges to add a new user.
 boolean canRemove(javax.jcr.Session jcrSession, String principalId)
          Checks whether the current user has been granted privileges to remove the specified user or group.
 boolean canUpdateGroupMembers(javax.jcr.Session jcrSession, String groupId)
          Checks whether the current user has been granted privileges to update the membership of the specified group.
 boolean canUpdateProperties(javax.jcr.Session jcrSession, String principalId)
          Checks whether the current user has been granted privileges to update the properties of the specified user or group.
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizablePrivilegesInfoImpl

public AuthorizablePrivilegesInfoImpl()
Method Detail

canAddGroup

public boolean canAddGroup(javax.jcr.Session jcrSession)
Description copied from interface: AuthorizablePrivilegesInfo
Checks whether the current user has been granted privileges to add a new group.

Specified by:
canAddGroup in interface AuthorizablePrivilegesInfo
Parameters:
jcrSession - the JCR session of the current user
Returns:
true if the current user has the privileges, false otherwise

canAddUser

public boolean canAddUser(javax.jcr.Session jcrSession)
Description copied from interface: AuthorizablePrivilegesInfo
Checks whether the current user has been granted privileges to add a new user.

Specified by:
canAddUser in interface AuthorizablePrivilegesInfo
Parameters:
jcrSession - the JCR session of the current user
Returns:
true if the current user has the privileges, false otherwise

canRemove

public boolean canRemove(javax.jcr.Session jcrSession,
                         String principalId)
Description copied from interface: AuthorizablePrivilegesInfo
Checks whether the current user has been granted privileges to remove the specified user or group.

Specified by:
canRemove in interface AuthorizablePrivilegesInfo
Parameters:
jcrSession - the JCR session of the current user
principalId - the user or group id to check
Returns:
true if the current user has the privileges, false otherwise

canUpdateGroupMembers

public boolean canUpdateGroupMembers(javax.jcr.Session jcrSession,
                                     String groupId)
Description copied from interface: AuthorizablePrivilegesInfo
Checks whether the current user has been granted privileges to update the membership of the specified group.

Specified by:
canUpdateGroupMembers in interface AuthorizablePrivilegesInfo
Parameters:
jcrSession - the JCR session of the current user
groupId - the group id to check
Returns:
true if the current user has the privileges, false otherwise

canUpdateProperties

public boolean canUpdateProperties(javax.jcr.Session jcrSession,
                                   String principalId)
Description copied from interface: AuthorizablePrivilegesInfo
Checks whether the current user has been granted privileges to update the properties of the specified user or group.

Specified by:
canUpdateProperties in interface AuthorizablePrivilegesInfo
Parameters:
jcrSession - the JCR session of the current user
principalId - the user or group id to check
Returns:
true if the current user has the privileges, false otherwise

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext)
                 throws InvalidKeyException,
                        NoSuchAlgorithmException,
                        IllegalStateException,
                        UnsupportedEncodingException
Called by SCR to activate the component.

Throws:
InvalidKeyException
NoSuchAlgorithmException
IllegalStateException
UnsupportedEncodingException

deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.