Package org.intermine.api.profile
Class ProfileManager.ApiPermission
- java.lang.Object
-
- org.intermine.api.profile.ProfileManager.ApiPermission
-
- All Implemented Interfaces:
java.security.Principal
- Enclosing class:
- ProfileManager
public static final class ProfileManager.ApiPermission extends java.lang.Object implements java.security.Principal
A representation of the level of permissions granted to a user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProfileManager.ApiPermission.Level
The possible permission levels.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRole(java.lang.String role)
Add a role to this permission.ProfileManager.ApiPermission.Level
getLevel()
java.lang.String
getName()
Profile
getProfile()
boolean
isInRole(java.lang.String role)
True if the permission granted includes access to this role.boolean
isRO()
boolean
isRW()
-
-
-
Method Detail
-
getProfile
public Profile getProfile()
- Returns:
- The profile associated with this level of permission.
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfacejava.security.Principal
-
getLevel
public ProfileManager.ApiPermission.Level getLevel()
- Returns:
- The level of permissions granted.
-
isRW
public boolean isRW()
- Returns:
- True if this user has been granted RW permissions.
-
isRO
public boolean isRO()
- Returns:
- True if this user has been granted RO permissions.
-
addRole
public void addRole(java.lang.String role)
Add a role to this permission.- Parameters:
role
- The role to add.
-
isInRole
public boolean isInRole(java.lang.String role)
True if the permission granted includes access to this role.- Parameters:
role
- The role in question.- Returns:
- Whether or not this user has access to the given role.
-
-