Dashboard Builder Security 6.0.0.CR4

org.jboss.dashboard.security
Class DefaultPermission

java.lang.Object
  extended by java.security.Permission
      extended by org.jboss.dashboard.security.DefaultPermission
All Implemented Interfaces:
Serializable, Guard

public class DefaultPermission
extends Permission

See Also:
Serialized Form

Field Summary
static int PERMISSION_DENIED
           
static int PERMISSION_GRANTED
           
static int PERMISSION_NOT_GRANTED
           
 
Constructor Summary
DefaultPermission(String resourceName, String actions)
          Creates a permission over the specified resource.
 
Method Summary
 void denyAction(String action)
           
 boolean equals(Object obj)
          Checks two BasicPermission objects for equality.
 String getActions()
           
 String getResourcePath()
           
 void grantAction(String action)
           
 int hashCode()
           
 boolean implies(Permission p)
           
 int impliesOrDenies(Permission p)
          Check both if this permission implies or denies the specified one.
 boolean isActionDenied(String action)
           
 boolean isActionGranted(String action)
           
 boolean isActionUndefined(String action)
           
 boolean isEmpty()
          If no actions are defined for this permission then assume as empty.
 PermissionCollection newPermissionCollection()
           
 void removeAction(String action)
           
 void setActions(String actions)
           
 void setResourceName(String resourceName)
           
protected  List toActionDeniedList(String actionList)
           
protected  List toActionGrantedList(String actionList)
           
protected  String toActionListString()
           
 String toString()
           
 
Methods inherited from class java.security.Permission
checkGuard, getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PERMISSION_GRANTED

public static final int PERMISSION_GRANTED
See Also:
Constant Field Values

PERMISSION_NOT_GRANTED

public static final int PERMISSION_NOT_GRANTED
See Also:
Constant Field Values

PERMISSION_DENIED

public static final int PERMISSION_DENIED
See Also:
Constant Field Values
Constructor Detail

DefaultPermission

public DefaultPermission(String resourceName,
                         String actions)
Creates a permission over the specified resource.

Parameters:
resourceName - A path to a resource. The naming convention follows the hierarchical property naming convention. The path format is the following: workspace{workspaceId}>.section{sectionId}.panel{panelId}.
An asterisk may appear at the end of the name, following a ".", or by itself, to signify a wildcard equals. For example: java.*, "workspace101.section102.*"
Method Detail

setResourceName

public void setResourceName(String resourceName)

getResourcePath

public String getResourcePath()

setActions

public void setActions(String actions)

grantAction

public void grantAction(String action)

denyAction

public void denyAction(String action)

removeAction

public void removeAction(String action)

isActionGranted

public boolean isActionGranted(String action)

isActionDenied

public boolean isActionDenied(String action)

isActionUndefined

public boolean isActionUndefined(String action)

isEmpty

public boolean isEmpty()
If no actions are defined for this permission then assume as empty.


impliesOrDenies

public int impliesOrDenies(Permission p)
Check both if this permission implies or denies the specified one.

Parameters:
p - The permission to check.
Returns:
A grant code. See constants definition at top of this class.

implies

public boolean implies(Permission p)
Specified by:
implies in class Permission

newPermissionCollection

public PermissionCollection newPermissionCollection()
Overrides:
newPermissionCollection in class Permission

equals

public boolean equals(Object obj)
Checks two BasicPermission objects for equality. Checks that obj's class is the same as this object's class and has the same name as this object.

Specified by:
equals in class Permission
Parameters:
obj - the object we are testing for equality with this object.
Returns:
true if obj is a BasicPermission, and has the same name as this BasicPermission object, false otherwise.

hashCode

public int hashCode()
Specified by:
hashCode in class Permission

getActions

public String getActions()
Specified by:
getActions in class Permission
Returns:
Actions granted/denied by this permission instance.
The string format is a list of words separated each one by a comma-character.
An action is denied if is preceeded by the character "!". Samples are:
"view" or "view, !edit".

toActionListString

protected String toActionListString()

toActionGrantedList

protected List toActionGrantedList(String actionList)

toActionDeniedList

protected List toActionDeniedList(String actionList)

toString

public String toString()
Overrides:
toString in class Permission

Dashboard Builder Security 6.0.0.CR4

Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.