public class TucsonPolicy extends java.lang.Object implements Policy
Constructor and Description |
---|
TucsonPolicy(java.lang.String polName) |
TucsonPolicy(java.lang.String polName,
java.util.List<Permission> perms)
Builds a policy given its name and the set of permissions
|
Modifier and Type | Method and Description |
---|---|
void |
addPermission(Permission permission)
Adds a permission to this policy.
|
static Policy |
createPolicy(java.lang.String policyName,
TupleArgument[] permissions)
Builds a policy given its name and the set of permissions
|
java.util.List<Permission> |
getPermissions()
Gets the permissions associated to this policy
|
java.lang.String |
getPolicyName()
Gets the name of this policy
|
boolean |
hasPermissions(java.util.List<java.lang.String> permName)
Checks whether this policy has ALL the given permissions
|
void |
removePermission(Permission permission)
Removes the given permission from this policy
|
void |
setPermissions(java.util.List<Permission> perms)
Replaces the permissions associated to this policy
|
void |
setPolicyName(java.lang.String polName)
Replaces the name of this policy
|
public TucsonPolicy(java.lang.String polName, java.util.List<Permission> perms)
polName
- the name of this policyperms
- the set of permissionspublic TucsonPolicy(java.lang.String polName)
public static Policy createPolicy(java.lang.String policyName, TupleArgument[] permissions)
policyName
- the name of this policypermissions
- the set of permissionspublic void addPermission(Permission permission)
Policy
addPermission
in interface Policy
permission
- the permission to addpublic java.util.List<Permission> getPermissions()
Policy
getPermissions
in interface Policy
public java.lang.String getPolicyName()
Policy
getPolicyName
in interface Policy
public boolean hasPermissions(java.util.List<java.lang.String> permName)
Policy
hasPermissions
in interface Policy
permName
- the set of permissions to checktrue
or false
depending on wether ALL the
permissions were foundpublic void removePermission(Permission permission)
Policy
removePermission
in interface Policy
permission
- the permission to removepublic void setPermissions(java.util.List<Permission> perms)
Policy
setPermissions
in interface Policy
perms
- the new set of permissionspublic void setPolicyName(java.lang.String polName)
Policy
setPolicyName
in interface Policy
polName
- the new name of this policy