Class Privilege

java.lang.Object
edu.internet2.middleware.grouper.privs.Privilege
All Implemented Interfaces:
Serializable

public class Privilege extends Object implements Serializable
Privilege schema specification. Access the constants for Groups from AccessPrivilege and Stems from NamingPrivilege.

Version:
$Id: Privilege.java,v 1.9 2009-09-21 06:14:26 mchyzer Exp $
See Also:
  • Field Details

  • Method Details

    • isAccess

      public boolean isAccess()
      see if privilege involves group
      Returns:
      if involves groups
    • isNaming

      public boolean isNaming()
      see if privilege involves stem
      Returns:
      if involves stems
    • isAttributeDef

      public boolean isAttributeDef()
      see if privilege involves attribute def
      Returns:
      if involves attribute def
    • listToPriv

      public static Privilege listToPriv(String list, boolean exceptionOnNotFound)
      convert a list to a privilege for any type of privilege
      Parameters:
      list -
      Returns:
      the privilege
    • convertFieldsToPrivileges

      public static Set<Privilege> convertFieldsToPrivileges(Collection<Field> fields)
      convert a list to a privilege for any type of privilege
      Parameters:
      fields -
      Returns:
      the privilege
    • convertNamesToPrivileges

      public static Set<Privilege> convertNamesToPrivileges(Collection<String> privilegeNames)
      convert a list of privilege names or field names to a privilege for any type of privilege
      Parameters:
      privilegeNames -
      Returns:
      the privilege
    • convertPrivilegesToFields

      public static Collection<Field> convertPrivilegesToFields(Collection<Privilege> privileges)
      convert a collection of privileges to a collection of fields
      Parameters:
      privileges -
      Returns:
      the fields
    • hashCode

      public int hashCode()
      generate hash code
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      string equals
      Overrides:
      equals in class Object
      Returns:
      if equal
    • getInheritedPrivileges

      public Collection<Privilege> getInheritedPrivileges()
      get the inherited privileges for this privilege (including this privilege for instance if the privilege is UPDATE, then return UPDATE and ADMIN
      Returns:
      the inherited privileges
    • getImpliedPrivileges

      public Collection<Privilege> getImpliedPrivileges()
      get the privilege that this privilege implied (including this privilege for instance if the privilege is UPDATE, then return UPDATE and ADMIN
      Returns:
      the inherited privileges
    • getListName

      public String getListName()
      return the list name
      Returns:
      the list name
    • getField

      public Field getField() throws SchemaException
      return the list name
      Returns:
      the list name
      Throws:
      SchemaException
    • getAccessPrivs

      public static Set<Privilege> getAccessPrivs()
      Returns:
      access (group) privs
    • getEntityPrivs

      public static Set<Privilege> getEntityPrivs()
      Returns:
      entity access (group) privs
    • getInstances

      public static Set<Privilege> getInstances(String namesCommaSeparated)
      Parameters:
      namesCommaSeparated -
      Returns:
      the privileges
    • stringValue

      public static String stringValue(Set<Privilege> privileges)
      convert privileges to string comma separated
      Parameters:
      privileges -
      Returns:
      the privileges
    • getInstance

      public static Privilege getInstance(String name)
      Parameters:
      name -
      Returns:
      priv
    • getInstance

      public static Privilege getInstance(String name, boolean exceptionIfNotFound)
      Parameters:
      name -
      exceptionIfNotFound -
      Returns:
      priv
    • getNamingPrivs

      public static Set<Privilege> getNamingPrivs()
      get stem (naming) privs
      Returns:
      set
    • getAttributeDefPrivs

      public static Set<Privilege> getAttributeDefPrivs()
      get attribute def privs
      Returns:
      attr def privs
    • isAccess

      public static boolean isAccess(Privilege p)
      Parameters:
      p -
      Returns:
      if access
    • isEntity

      public static boolean isEntity(Privilege p)
      Parameters:
      p -
      Returns:
      if entity
    • isNaming

      public static boolean isNaming(Privilege p)
      Parameters:
      p -
      Returns:
      if naming (stem)
    • isAttributeDef

      public static boolean isAttributeDef(Privilege p)
      Parameters:
      p -
      Returns:
      if attribute def
    • getName

      public String getName()
      Returns:
      name
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: