org.apache.jetspeed.om.registry.base
Class BaseSecurityEntry

java.lang.Object
  extended byorg.apache.jetspeed.om.registry.base.BaseRegistryEntry
      extended byorg.apache.jetspeed.om.registry.base.BaseSecurityEntry
All Implemented Interfaces:
RegistryEntry, SecurityEntry, java.io.Serializable

public class BaseSecurityEntry
extends BaseRegistryEntry
implements SecurityEntry, java.io.Serializable

Interface for manipulatin the Security Entry on the registry entries

Version:
$Id: BaseSecurityEntry.java,v 1.18 2005/01/25 23:45:28 morciuch Exp $
Author:
Paul Spencer, Scott T. Weaver, Mark Orciuch
See Also:
Serialized Form

Field Summary
static java.lang.String ALL_ACTIONS
           
static java.lang.String ALL_GROUP_ROLES
           
static java.lang.String ALL_GROUPS
           
static java.lang.String ALL_ROLES
           
static java.lang.String ALL_USERS
           
 
Fields inherited from class org.apache.jetspeed.om.registry.base.BaseRegistryEntry
_hidden, hidden, id, metaInfo, name, security, securityRef
 
Constructor Summary
BaseSecurityEntry()
           
BaseSecurityEntry(long id)
           
 
Method Summary
 boolean allowsGroup(java.lang.String group, java.lang.String action)
          Aututhorizes action for a group.
 boolean allowsGroupRole(java.lang.String group, java.lang.String role, java.lang.String action)
          Authorizes action for a group role.
 boolean allowsRole(java.lang.String role, java.lang.String action)
          Aututhorizes action for a role.
 boolean allowsSpecificGroup(java.lang.String action, java.lang.String group)
          Checks whether a group is specifically allowed to access the request action This method ignores the "*" action and is here to play a maintenance role.
 boolean allowsSpecificGroupRole(java.lang.String action, java.lang.String group, java.lang.String role)
          Checks whether a group role is specifically allowed to access the request action This method ignores the "*" action and is here to play a maintenance role.
 boolean allowsSpecificRole(java.lang.String action, java.lang.String role)
          Checks whether a role is specifically allowed to access the request action This method ignores the "*" action and is here to play a maintenance role.
 boolean allowsSpecificUser(java.lang.String action, java.lang.String user)
          Checks whether a role is specifically allowed to access the request action This method ignores the "*" action and is here to play a maintenance role.
 boolean allowsUser(java.lang.String userName, java.lang.String action)
          Aututhorizes action for a named user
 boolean allowsUser(java.lang.String userName, java.lang.String action, java.lang.String owner)
          Aututhorizes action for a named user
 boolean equals(java.lang.Object object)
          Implements the equals operation so that 2 elements are equal if all their member values are equal.
 SecurityAccess getAccess(java.lang.String action)
          Returns the SecurityAccess object for the action requested or null if no specific access is defined for this action.
 java.util.Vector getAccesses()
          Getter for property accesses.
 boolean grantGroupAccess(java.lang.String action, java.lang.String group)
          Grants access for a specific action to a specific group for this SecurityEntry.
 boolean grantGroupRoleAccess(java.lang.String action, java.lang.String group, java.lang.String role)
          Grants access for a specific action to a specific group fole for this SecurityEntry.
 boolean grantRoleAccess(java.lang.String action, java.lang.String role)
          Grants access for a specific action to a specific role for this SecurityEntry.
 boolean grantUserAccess(java.lang.String action, java.lang.String user)
          Grants access for a specific action to a specific user for this SecurityEntry.
 void revokeAccess(java.lang.String action)
          Removes a security access for the named action.
 boolean revokeGroupAccess(java.lang.String action, java.lang.String group)
          Removes a group's access to a specific action.
 boolean revokeGroupRoleAccess(java.lang.String action, java.lang.String group, java.lang.String role)
          Removes a group role's access to a specific action.
 boolean revokeRoleAccess(java.lang.String action, java.lang.String role)
          Removes a role's access to a specific action.
 boolean revokeUserAccess(java.lang.String action, java.lang.String user)
          Removes a user's access to a specific action.
 void setAccesses(java.util.Vector accesses)
          Setter for property accesses.
 
Methods inherited from class org.apache.jetspeed.om.registry.base.BaseRegistryEntry
getBaseMetaInfo, getBaseSecurity, getDescription, getHidden, getId, getMetaInfo, getName, getSecurity, getSecurityRef, getTitle, isHidden, setBaseMetaInfo, setBaseSecurity, setDescription, setHidden, setMetaInfo, setName, setSecurity, setSecurityRef, setTitle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.om.registry.SecurityEntry
getDescription, getId, getMetaInfo, getName, getSecurityRef, getTitle, isHidden, setDescription, setHidden, setMetaInfo, setName, setSecurityRef, setTitle
 

Field Detail

ALL_ACTIONS

public static final java.lang.String ALL_ACTIONS
See Also:
Constant Field Values

ALL_ROLES

public static final java.lang.String ALL_ROLES
See Also:
Constant Field Values

ALL_GROUPS

public static final java.lang.String ALL_GROUPS
See Also:
Constant Field Values

ALL_GROUP_ROLES

public static final java.lang.String ALL_GROUP_ROLES
See Also:
Constant Field Values

ALL_USERS

public static final java.lang.String ALL_USERS
See Also:
Constant Field Values
Constructor Detail

BaseSecurityEntry

public BaseSecurityEntry()

BaseSecurityEntry

public BaseSecurityEntry(long id)
Method Detail

equals

public boolean equals(java.lang.Object object)
Implements the equals operation so that 2 elements are equal if all their member values are equal.

Overrides:
equals in class BaseRegistryEntry

getAccesses

public java.util.Vector getAccesses()
Getter for property accesses.

Specified by:
getAccesses in interface SecurityEntry
Returns:
Value of property accesses.

setAccesses

public void setAccesses(java.util.Vector accesses)
Setter for property accesses.

Specified by:
setAccesses in interface SecurityEntry
Parameters:
accesses - New value of property accesses.

allowsRole

public boolean allowsRole(java.lang.String role,
                          java.lang.String action)
Aututhorizes action for a role. o If the requested action and the action ALL_ACTIONS do not exist, then return false. o If the requesting role and ALL_ROLES does not exist for the the action, then return false.

Specified by:
allowsRole in interface SecurityEntry
Parameters:
role - requesting action
action - being requested
Returns:
true if action is allowed for role

allowsGroup

public boolean allowsGroup(java.lang.String group,
                           java.lang.String action)
Aututhorizes action for a group. o If the requested action and the action ALL_ACTIONS do not exist, then return false. o If the requesting role and ALL_GROUP does not exist for the the action, then return false.

Specified by:
allowsGroup in interface SecurityEntry
Parameters:
group - requesting action
action - being requested
Returns:
true if action is allowed for group

allowsGroupRole

public boolean allowsGroupRole(java.lang.String group,
                               java.lang.String role,
                               java.lang.String action)
Authorizes action for a group role. o If the requested action and the action ALL_ACTIONS do not exist, then return false. o If the requesting group role and ALL_GROUPS_ROLES does not exist for the the action, then return false.

Specified by:
allowsGroupRole in interface SecurityEntry
Parameters:
group - requesting action
role - requesting action
action - being requested
Returns:
true if action is allowed for group role

allowsUser

public boolean allowsUser(java.lang.String userName,
                          java.lang.String action)
Aututhorizes action for a named user

Specified by:
allowsUser in interface SecurityEntry
Parameters:
userName - requesting action
action - being requested
Returns:
true if action is allowed for named user

allowsUser

public boolean allowsUser(java.lang.String userName,
                          java.lang.String action,
                          java.lang.String owner)
Aututhorizes action for a named user

Specified by:
allowsUser in interface SecurityEntry
Parameters:
userName - requesting action
action - being requested
owner - User
Returns:
true if action is allowed for named user

allowsSpecificRole

public boolean allowsSpecificRole(java.lang.String action,
                                  java.lang.String role)
Checks whether a role is specifically allowed to access the request action This method ignores the "*" action and is here to play a maintenance role.

Specified by:
allowsSpecificRole in interface SecurityEntry
Returns:
boolean whether or not the role has access to this specific action.

allowsSpecificGroup

public boolean allowsSpecificGroup(java.lang.String action,
                                   java.lang.String group)
Checks whether a group is specifically allowed to access the request action This method ignores the "*" action and is here to play a maintenance role.

Specified by:
allowsSpecificGroup in interface SecurityEntry
Returns:
boolean whether or not the group has access to this specific action.

allowsSpecificGroupRole

public boolean allowsSpecificGroupRole(java.lang.String action,
                                       java.lang.String group,
                                       java.lang.String role)
Checks whether a group role is specifically allowed to access the request action This method ignores the "*" action and is here to play a maintenance role.

Specified by:
allowsSpecificGroupRole in interface SecurityEntry
Returns:
boolean whether or not the group role has access to this specific action.

allowsSpecificUser

public boolean allowsSpecificUser(java.lang.String action,
                                  java.lang.String user)
Checks whether a role is specifically allowed to access the request action This method ignores the "*" action and is here to play a maintenance role.

Specified by:
allowsSpecificUser in interface SecurityEntry
Returns:
boolean whether or not the role has access to this specific action.

getAccess

public SecurityAccess getAccess(java.lang.String action)
Returns the SecurityAccess object for the action requested or null if no specific access is defined for this action. The "*" does change this, if an action is not specifically defined in the registry, null is returned

Specified by:
getAccess in interface SecurityEntry
Returns:
SecurityAccess that is defined for this action or null if one is not specifically defined

grantRoleAccess

public boolean grantRoleAccess(java.lang.String action,
                               java.lang.String role)
Grants access for a specific action to a specific role for this SecurityEntry. This grants specific access ignores "*" action, if it exists.

Specified by:
grantRoleAccess in interface SecurityEntry
Returns:
boolean Whether or not the access was granted. Basically, a false means that this role already has specific access.

grantGroupAccess

public boolean grantGroupAccess(java.lang.String action,
                                java.lang.String group)
Grants access for a specific action to a specific group for this SecurityEntry. This grants specific access ignores "*" action, if it exists.

Specified by:
grantGroupAccess in interface SecurityEntry
Returns:
boolean Whether or not the access was granted. Basically, a false means that this group already has specific access.

grantGroupRoleAccess

public boolean grantGroupRoleAccess(java.lang.String action,
                                    java.lang.String group,
                                    java.lang.String role)
Grants access for a specific action to a specific group fole for this SecurityEntry. This grants specific access ignores "*" action, if it exists.

Specified by:
grantGroupRoleAccess in interface SecurityEntry
Returns:
boolean Whether or not the access was granted. Basically, a false means that this group role already has specific access.

grantUserAccess

public boolean grantUserAccess(java.lang.String action,
                               java.lang.String user)
Grants access for a specific action to a specific user for this SecurityEntry. This grants specific access ignores "*" action, if it exists.

Specified by:
grantUserAccess in interface SecurityEntry
Returns:
boolean Whether or not the access was granted. Basically, a false means that this role already has specific access.

revokeRoleAccess

public boolean revokeRoleAccess(java.lang.String action,
                                java.lang.String role)
Removes a role's access to a specific action.

Specified by:
revokeRoleAccess in interface SecurityEntry
Parameters:
action - Action to remove access from.
role - The role whose access we are revoking.
Returns:
boolean Whehter or not the access existed and was removed.

revokeGroupAccess

public boolean revokeGroupAccess(java.lang.String action,
                                 java.lang.String group)
Removes a group's access to a specific action.

Specified by:
revokeGroupAccess in interface SecurityEntry
Parameters:
action - Action to remove access from.
group - The group whose access we are revoking.
Returns:
boolean Whehter or not the access existed and was removed.

revokeGroupRoleAccess

public boolean revokeGroupRoleAccess(java.lang.String action,
                                     java.lang.String group,
                                     java.lang.String role)
Removes a group role's access to a specific action.

Specified by:
revokeGroupRoleAccess in interface SecurityEntry
Parameters:
action - Action to remove access from.
group - The group whose access we are revoking.
role - The role whose access we are revoking.
Returns:
boolean Whether or not the access existed and was removed.

revokeUserAccess

public boolean revokeUserAccess(java.lang.String action,
                                java.lang.String user)
Removes a user's access to a specific action.

Specified by:
revokeUserAccess in interface SecurityEntry
Parameters:
action - Action to remove access from.
Returns:
boolean Whehter or not the access existed and was removed.

revokeAccess

public void revokeAccess(java.lang.String action)
Removes a security access for the named action. This does not take into account the "*" action when the "*" is not the named action.

Specified by:
revokeAccess in interface SecurityEntry


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.