Package ome.security.basic
Class LightAdminPrivileges
- java.lang.Object
-
- ome.security.basic.LightAdminPrivileges
-
public class LightAdminPrivileges extends java.lang.Object
Report the light administrator privileges associated with a given session. Caches recent results.- Since:
- 5.4.0
-
-
Constructor Summary
Constructors Constructor Description LightAdminPrivileges(ome.system.Roles roles)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.google.common.collect.ImmutableSet<ome.model.enums.AdminPrivilege>
getAllPrivileges()
java.lang.String
getConfigNameForPrivilege(ome.model.enums.AdminPrivilege privilege)
ome.model.enums.AdminPrivilege
getPrivilege(java.lang.String value)
ome.model.enums.AdminPrivilege
getPrivilegeForConfigName(java.lang.String value)
com.google.common.collect.ImmutableSet<ome.model.enums.AdminPrivilege>
getSessionPrivileges(ome.model.meta.Session session)
Determine the light administrator privileges associated with a session.
-
-
-
Method Detail
-
getAllPrivileges
public static com.google.common.collect.ImmutableSet<ome.model.enums.AdminPrivilege> getAllPrivileges()
- Returns:
- all the light administrator privileges
-
getPrivilegeForConfigName
public ome.model.enums.AdminPrivilege getPrivilegeForConfigName(java.lang.String value)
- Parameters:
value
- the string value of a light administrator privilege as recorded inExperimenter.config.name
- Returns:
- the corresponding privilege, or
null
if there is no privilege with that string value
-
getConfigNameForPrivilege
public java.lang.String getConfigNameForPrivilege(ome.model.enums.AdminPrivilege privilege)
- Parameters:
privilege
- a light administrator privilege- Returns:
- the string value of the given privilege as recorded in
Experimenter.config.name
-
getPrivilege
public ome.model.enums.AdminPrivilege getPrivilege(java.lang.String value)
- Parameters:
value
- the string value of a light administrator privilege- Returns:
- the corresponding privilege, or
null
if there is no privilege with that string value
-
getSessionPrivileges
public com.google.common.collect.ImmutableSet<ome.model.enums.AdminPrivilege> getSessionPrivileges(ome.model.meta.Session session)
Determine the light administrator privileges associated with a session. If the session originates viasudo
, takes that into account. Does not take account of if the relevant user is a member of system: calculates assuming that the user is an administrator. Caches newly fetched privileges for future lookups.- Parameters:
session
- an OMERO session- Returns:
- the light administrator privileges associated with the session
-
-