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 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LightAdminPrivileges

        public LightAdminPrivileges​(ome.system.Roles roles)
        Parameters:
        roles - the OMERO roles
    • 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 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