|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.slide.security.SecurityImpl
Security helper.
Field Summary | |
protected int |
aclInheritanceType
|
protected Logger |
logger
|
protected Namespace |
namespace
Namespace. |
protected NamespaceConfig |
namespaceConfig
Namespace configuration. |
protected java.util.Hashtable |
rolesCache
Roles cache. |
Constructor Summary | |
SecurityImpl()
Constructor. |
|
SecurityImpl(Namespace namespace,
NamespaceConfig namespaceConfig)
Constructor. |
Method Summary | |
void |
checkCredentials(SlideToken token,
ObjectNode object,
ActionNode action)
Check if the credentials given grants permission to perform the specified action on the specified subject. |
void |
checkPermission(ObjectNode object,
SubjectNode subject,
ActionNode action)
Check whether or not an actor can perform the specified activity on a collection. |
void |
checkPermission(SlideToken token,
ObjectNode object,
ActionNode action)
Check whether or not an actor (principal) can perform the specified activity on the specified resource. |
void |
denyPermission(SlideToken token,
NodePermission permission)
Deny a new permission. |
void |
denyPermission(SlideToken token,
ObjectNode object,
SubjectNode subject,
ActionNode action)
Deny a new permission. |
void |
denyPermission(SlideToken token,
ObjectNode object,
SubjectNode subject,
ActionNode action,
boolean inheritable)
Deny a new permission. |
java.util.Enumeration |
enumeratePermissions(SlideToken token,
ObjectNode object)
Enumerates permissions on an object. |
java.util.Enumeration |
enumeratePermissions(SlideToken token,
ObjectNode object,
boolean includeInherited)
Enumerates permissions on an object. |
java.util.Enumeration |
enumeratePermissions(SlideToken token,
java.lang.String object)
Enumerates permissions on an object. |
java.util.Enumeration |
enumeratePermissions(SlideToken token,
java.lang.String object,
boolean includeInherited)
Enumerates permissions on an object. |
java.util.Map |
getActionAggregation()
Method getActionAggregation |
ObjectNode |
getPrincipal(SlideToken token)
Get the SubjectNode associated with the credentials token. |
java.util.Enumeration |
getRoles(ObjectNode object)
Return the list of roles the specified node has. |
java.util.Enumeration |
getRoles(SlideToken token)
Return the list of roles the specified token has. |
java.util.Enumeration |
getRoles(SlideToken token,
SubjectNode subjectNode)
|
void |
grantPermission(SlideToken token,
NodePermission permission)
Grants a new permission. |
void |
grantPermission(SlideToken token,
ObjectNode object,
SubjectNode subject,
ActionNode action)
Grants a new permission. |
void |
grantPermission(SlideToken token,
ObjectNode object,
SubjectNode subject,
ActionNode action,
boolean inheritable)
Grants a new permission. |
boolean |
hasPermission(ObjectNode object,
SubjectNode subject,
ActionNode action)
Check whether or not an actor can perform the specified activity on a collection. |
boolean |
hasPermission(SlideToken token,
ObjectNode object,
ActionNode action)
Check whether or not an actor (principal) can perform the specified activity on the specified resource. |
boolean |
hasRole(ObjectNode object,
java.lang.String role)
Check whether or not the current user has the specified role. |
boolean |
hasRole(SlideToken token,
java.lang.String role)
Check whether or not the current user has the specified role. |
void |
init(Namespace namespace,
NamespaceConfig namespaceConfig)
initialises the security if it has been loaded via reflection |
boolean |
matchAction(SlideToken token,
ActionNode checkAction,
ActionNode permAction)
Return true, if-and-only-if checkAction matches permAction. |
boolean |
matchPrincipal(SlideToken token,
SubjectNode checkSubject,
SubjectNode matchSubject)
Return true, if-and-only-if checkSubject matches permSubject. |
boolean |
matchPrincipal(SlideToken token,
SubjectNode checkSubject,
SubjectNode matchSubject,
int level)
Return true, if-and-only-if checkSubject matches permSubject. |
java.util.List |
retrieveAclSourceNodes(SlideToken token,
ObjectNode object)
Retrieve the list of object nodes from which to get the ACLs. |
void |
revokePermission(SlideToken token,
NodePermission permission)
Revokes a permission. |
void |
revokePermission(SlideToken token,
ObjectNode object,
SubjectNode subject,
ActionNode action)
Revokes a permission. |
void |
setPermissions(SlideToken token,
java.lang.String object,
java.util.Enumeration permissions)
Set a new set of permissions on an object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Logger logger
protected Namespace namespace
protected NamespaceConfig namespaceConfig
protected java.util.Hashtable rolesCache
protected int aclInheritanceType
Constructor Detail |
public SecurityImpl()
public SecurityImpl(Namespace namespace, NamespaceConfig namespaceConfig)
namespace
- NamespacenamespaceConfig
- Namespace configurationMethod Detail |
public void init(Namespace namespace, NamespaceConfig namespaceConfig)
Security
init
in interface Security
namespace
- NamespacenamespaceConfig
- Namespace configurationpublic void setPermissions(SlideToken token, java.lang.String object, java.util.Enumeration permissions) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
setPermissions
in interface Security
token
- Credentials tokenobject
- Object on which permission is granted
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void grantPermission(SlideToken token, ObjectNode object, SubjectNode subject, ActionNode action) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
grantPermission
in interface Security
token
- Credentials tokenobject
- Object on which permission is grantedsubject
- The subject to whom the permission is granted.action
- The action which the subject can perform
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void grantPermission(SlideToken token, ObjectNode object, SubjectNode subject, ActionNode action, boolean inheritable) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
grantPermission
in interface Security
token
- Credentials tokenobject
- Object on which permission is grantedsubject
- Subject who can perform the actionaction
- Action which can be performedinheritable
- Create an inheritable permission
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void grantPermission(SlideToken token, NodePermission permission) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
grantPermission
in interface Security
token
- Credentials tokenpermission
- New permission
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void denyPermission(SlideToken token, ObjectNode object, SubjectNode subject, ActionNode action) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
denyPermission
in interface Security
token
- Credentials tokenobject
- Object on which permission is deniedsubject
- The subject to whom a action is deniedaction
- The action which is denied
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void denyPermission(SlideToken token, ObjectNode object, SubjectNode subject, ActionNode action, boolean inheritable) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
denyPermission
in interface Security
token
- Credentials tokenobject
- Object on which permission is grantedsubject
- Subject who can perform the actionaction
- Action which can be performedinheritable
- Create an inheritable permission
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void denyPermission(SlideToken token, NodePermission permission) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
denyPermission
in interface Security
token
- Credentials tokenpermission
- New permission
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void revokePermission(SlideToken token, ObjectNode object, SubjectNode subject, ActionNode action) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
revokePermission
in interface Security
token
- Credentials tokenobject
- Object on which permission is revokedsubject
- Subject who can perform the actionaction
- Action which can be performed
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void revokePermission(SlideToken token, NodePermission permission) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
revokePermission
in interface Security
token
- Credentials tokenpermission
- Permission to be removed
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void checkCredentials(SlideToken token, ObjectNode object, ActionNode action) throws ServiceAccessException, AccessDeniedException
checkCredentials
in interface Security
token
- Credentials tokenobject
- Object on which the action is performedaction
- Action performed
ServiceAccessException
- DataSource access error
AccessDeniedException
- The credentials does not grant
the permission to perform the specified actionpublic void checkPermission(ObjectNode object, SubjectNode subject, ActionNode action) throws ServiceAccessException, AccessDeniedException, ObjectNotFoundException
checkPermission
in interface Security
object
- Object on which access is testedsubject
- Subject who seeks to perform the actionaction
- Action which is to be performed
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic void checkPermission(SlideToken token, ObjectNode object, ActionNode action) throws ServiceAccessException, AccessDeniedException, ObjectNotFoundException
checkPermission
in interface Security
token
- a SlideTokenobject
- Object on which access is testedaction
- Action which is to be performed
ServiceAccessException
AccessDeniedException
ObjectNotFoundException
public boolean hasPermission(ObjectNode object, SubjectNode subject, ActionNode action) throws ServiceAccessException, ObjectNotFoundException
hasPermission
in interface Security
object
- Object on which access is testedsubject
- Subject who seeks to perform the actionaction
- Action which is to be performed
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSourcepublic boolean hasPermission(SlideToken token, ObjectNode object, ActionNode action) throws ServiceAccessException, ObjectNotFoundException
hasPermission
in interface Security
token
- a SlideTokenobject
- Object on which access is testedaction
- Action which is to be performed
ServiceAccessException
ObjectNotFoundException
public java.util.Enumeration enumeratePermissions(SlideToken token, ObjectNode object) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
enumeratePermissions
in interface Security
token
- Credentials tokenobject
- Object on which permission is granted
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic java.util.Enumeration enumeratePermissions(SlideToken token, ObjectNode object, boolean includeInherited) throws ServiceAccessException, ObjectNotFoundException
enumeratePermissions
in interface Security
token
- Credentials tokenobject
- Object on which permission is grantedincludeInherited
- if true, includes inherited permissions
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic java.util.Enumeration enumeratePermissions(SlideToken token, java.lang.String object) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException
enumeratePermissions
in interface Security
token
- Credentials tokenobject
- Object on which permission is granted
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic java.util.Enumeration enumeratePermissions(SlideToken token, java.lang.String object, boolean includeInherited) throws ServiceAccessException, ObjectNotFoundException
enumeratePermissions
in interface Security
token
- Credentials tokenobject
- Object on which permission is grantedincludeInherited
- if true, includes inherited permissions
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSource
AccessDeniedException
- Insufficent credentialspublic java.util.List retrieveAclSourceNodes(SlideToken token, ObjectNode object) throws ServiceAccessException, ObjectNotFoundException
token
- a SlideTokenobject
- an ObjectNode
ServiceAccessException
ObjectNotFoundException
public boolean hasRole(SlideToken token, java.lang.String role) throws ServiceAccessException, ObjectNotFoundException
hasRole
in interface Security
token
- Credentials tokenrole
- Role
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSourcepublic boolean hasRole(ObjectNode object, java.lang.String role) throws ServiceAccessException, ObjectNotFoundException
hasRole
in interface Security
object
- Object noderole
- Role
ServiceAccessException
- DataSource access error
ObjectNotFoundException
- Specified object was not found
in the DataSourcepublic java.util.Enumeration getRoles(ObjectNode object)
getRoles
in interface Security
object
- Object nodepublic java.util.Enumeration getRoles(SlideToken token) throws ServiceAccessException, ObjectNotFoundException
getRoles
in interface Security
token
- Credentials token
ServiceAccessException
ObjectNotFoundException
public java.util.Enumeration getRoles(SlideToken token, SubjectNode subjectNode) throws ServiceAccessException, ObjectNotFoundException
getRoles
in interface Security
ServiceAccessException
ObjectNotFoundException
public ObjectNode getPrincipal(SlideToken token) throws ServiceAccessException, ObjectNotFoundException
getPrincipal
in interface Security
token
- a SlideToken
ServiceAccessException
ObjectNotFoundException
public boolean matchAction(SlideToken token, ActionNode checkAction, ActionNode permAction) throws ServiceAccessException
matchAction
in interface Security
checkAction
- the "current" actionpermAction
- the action to check against
(from NodePermission or NodeLock)token
- a SlideToken
ServiceAccessException
public boolean matchPrincipal(SlideToken token, SubjectNode checkSubject, SubjectNode matchSubject) throws ServiceAccessException
matchPrincipal
in interface Security
token
- a SlideTokencheckSubject
- the "current" principalmatchSubject
- the principal to check against (e.g. user
or group from NodePermission or NodeLock)
ServiceAccessException
public boolean matchPrincipal(SlideToken token, SubjectNode checkSubject, SubjectNode matchSubject, int level) throws ServiceAccessException
token
- a SlideTokencheckSubject
- the "current" principalmatchSubject
- the principal to check against (e.g. user
or group from NodePermission or NodeLock)
ServiceAccessException
public java.util.Map getActionAggregation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |