Package io.bdeploy.common.security
Class ScopedPermission
java.lang.Object
io.bdeploy.common.security.ScopedPermission
Describes access rights to a given resource. Access rights can either be global or restricted (=scoped) to a given
resource. Global permissions take precedence over scoped permissions. Thus a user having global read permissions is allowed to
access any scoped resource with READ permissions. In contrast to that a user that has scoped READ permissions is not able to
access a resource requiring global read permissions.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScopedPermission(ScopedPermission.Permission permission) Creates a new global permission.ScopedPermission(String scope, ScopedPermission.Permission permission) Creates a new scoped permission allowing access to a particular resource. -
Method Summary
-
Field Details
-
scope
-
permission
-
-
Constructor Details
-
ScopedPermission
Creates a new global permission.- Parameters:
permission- the permission
-
ScopedPermission
Creates a new scoped permission allowing access to a particular resource.- Parameters:
scope- the scope of the resourcepermission- the permission
-
-
Method Details
-
toString
-
hashCode
@Generated("Eclipse") public int hashCode() -
equals
-
isGlobal
public boolean isGlobal()Returns whether or not this is a global scoped permission -
satisfies
Checks whether or not this permission satisfies the given one. Permissions are inclusive and ADMIN is the highest one. The ADMIN permission implicitly grants WRITE and READ and the WRITE permission implicitly grants READ permission.- If this token is a global one then the scoped of the other one is ignored. Just the permission without the scoped is checked.
- If this token is a scoped one and the other one is a global then always
falsewill be returned. - If both are scoped permissions then the scope must match. If so the permission will be compared.
- Parameters:
other- the permission to check- Returns:
trueif this permission satisfies the other one andfalseotherwise
-