public class Permission extends Object
| Constructor and Description |
|---|
Permission()
Empty constructor
|
Permission(String userId,
String target,
Role role)
Full constructor
|
| Modifier and Type | Method and Description |
|---|---|
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
|
public String getUserId()
public void setUserId(String userId)
userId - public Role getRole()
public void setRole(Role role)
role - public String getTarget()
public void setTarget(String target)
target - public boolean isAllowed(Action a)
a - public boolean isAllowed(Action a, String object)
a - object - Copyright © 2014. All Rights Reserved.