Class 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 Detail

      • LightAdminPrivileges

        public LightAdminPrivileges​(ome.system.Roles roles)
        Parameters:
        roles - the OMERO roles
    • Method Detail

      • getPrivilegeForConfigName

        public ome.model.enums.AdminPrivilege getPrivilegeForConfigName​(java.lang.String value)
        Parameters:
        value - the string value of a light administrator privilege as recorded in Experimenter.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 via sudo, 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