org.gcube.accounting.security.authz
Class Permission

java.lang.Object
  extended by org.gcube.accounting.security.authz.Permission

public class Permission
extends Object


Constructor Summary
Permission()
          Empty constructor
Permission(String userId, String target, Role role)
          Full constructor
 
Method Summary
 Role getRole()
          Return the user role
 String getTarget()
          Return the target of the permission
 String getUserId()
          Return the user identity
 boolean isAllowed(Action a)
          Check whether the given action is allowed by this permission
 boolean isAllowed(Action a, String object)
          Check whether the given action on the given target is allowed by this permission
 void setRole(Role role)
          Set the user role over the target
 void setTarget(String target)
          Set the target of the permission
 void setUserId(String userId)
          Set the user identity
 String toString()
          Provide a string representation for this permission
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Permission

public Permission()
Empty constructor


Permission

public Permission(String userId,
                  String target,
                  Role role)
Full constructor

Method Detail

getUserId

public String getUserId()
Return the user identity

Returns:

setUserId

public void setUserId(String userId)
Set the user identity

Parameters:
userId -

getRole

public Role getRole()
Return the user role

Returns:

setRole

public void setRole(Role role)
Set the user role over the target

Parameters:
role -

getTarget

public String getTarget()
Return the target of the permission

Returns:

setTarget

public void setTarget(String target)
Set the target of the permission

Parameters:
target -

isAllowed

public boolean isAllowed(Action a)
Check whether the given action is allowed by this permission

Parameters:
a -
Returns:

isAllowed

public boolean isAllowed(Action a,
                         String object)
Check whether the given action on the given target is allowed by this permission

Parameters:
a -
object -
Returns:

toString

public String toString()
Provide a string representation for this permission

Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.