public class SimpleSystemPermissionSet extends Object implements SystemPermissionSet
Constructor and Description |
---|
SimpleSystemPermissionSet()
Creates a new empty SimpleSystemPermissionSet.
|
SimpleSystemPermissionSet(Set<SystemPermission> permissions)
Creates a new SimpleSystemPermissionSet which contains the permissions
within the given Set.
|
Modifier and Type | Method and Description |
---|---|
void |
addPermission(SystemPermission.Type permission)
Adds the specified permission.
|
void |
addPermissions(Set<SystemPermission> permissions)
Adds the specified permissions, if not already granted.
|
Set<SystemPermission> |
getPermissions()
Returns a Set which contains all permissions granted within this
permission set.
|
boolean |
hasPermission(SystemPermission.Type permission)
Tests whether the permission of the given type is granted.
|
void |
removePermission(SystemPermission.Type permission)
Removes the specified permission.
|
void |
removePermissions(Set<SystemPermission> permissions)
Removes each of the specified permissions, if granted.
|
protected void |
setPermissions(Set<SystemPermission> permissions)
Sets the Set which backs this SimpleSystemPermissionSet.
|
public SimpleSystemPermissionSet()
public SimpleSystemPermissionSet(Set<SystemPermission> permissions)
permissions
- The Set of permissions this SimpleSystemPermissionSet should
contain.protected void setPermissions(Set<SystemPermission> permissions)
permissions
- The Set of permissions this SimpleSystemPermissionSet should
contain.public Set<SystemPermission> getPermissions()
PermissionSet
getPermissions
in interface PermissionSet<SystemPermission>
getPermissions
in interface SystemPermissionSet
public boolean hasPermission(SystemPermission.Type permission) throws org.apache.guacamole.GuacamoleException
SystemPermissionSet
hasPermission
in interface SystemPermissionSet
permission
- The permission to check.org.apache.guacamole.GuacamoleException
- If an error occurs while checking permissions, or if permissions
cannot be checked due to lack of permissions to do so.public void addPermission(SystemPermission.Type permission) throws org.apache.guacamole.GuacamoleException
SystemPermissionSet
addPermission
in interface SystemPermissionSet
permission
- The permission to add.org.apache.guacamole.GuacamoleException
- If an error occurs while adding the permission, or if permission to
add permissions is denied.public void removePermission(SystemPermission.Type permission) throws org.apache.guacamole.GuacamoleException
SystemPermissionSet
removePermission
in interface SystemPermissionSet
permission
- The permission to remove.org.apache.guacamole.GuacamoleException
- If an error occurs while removing the permission, or if permission
to remove permissions is denied.public void addPermissions(Set<SystemPermission> permissions) throws org.apache.guacamole.GuacamoleException
PermissionSet
addPermissions
in interface PermissionSet<SystemPermission>
addPermissions
in interface SystemPermissionSet
permissions
- The permissions to add.org.apache.guacamole.GuacamoleException
- If an error occurs while adding the permissions, or if permission to
add permissions is denied.public void removePermissions(Set<SystemPermission> permissions) throws org.apache.guacamole.GuacamoleException
PermissionSet
removePermissions
in interface PermissionSet<SystemPermission>
removePermissions
in interface SystemPermissionSet
permissions
- The permissions to remove.org.apache.guacamole.GuacamoleException
- If an error occurs while removing the permissions, or if permission
to remove permissions is denied.Copyright © 2016. All rights reserved.