Class PermissionDao


  • public class PermissionDao
    extends AbstractDao
    Provides a DAO for the Permission entity.
    See Also:
    Permission
    • Constructor Detail

      • PermissionDao

        public PermissionDao()
    • Method Detail

      • getPermission

        public Permission getPermission​(Object id)
        Return the permission with the specified OID
        Parameters:
        id - the OID
        Returns:
        the matching permission, or null if not found
      • getPermissionByName

        public Permission getPermissionByName​(String name,
                                              String portalId)
        Return the permission with the given name
        Parameters:
        name - the non-empty name of the permission
        portalId - the OID of the portal associated with the permission
        Returns:
        the permission object for the given name
      • getPermissionByNameAndPortal

        public Permission getPermissionByNameAndPortal​(String name,
                                                       String portalName)
        Return the permission with the given name belonging to the portal with the given name
        Parameters:
        name - the non-empty name of the permission
        portalName - the non-empty name of the portal associated with the permission
        Returns:
        the matching permission object
      • getPermissionByNameAndPortal

        public Permission getPermissionByNameAndPortal​(String name,
                                                       Portal portal)
        Return the permission with the given name belonging to the portal with the given name
        Parameters:
        name - the non-empty name of the permission (required)
        portal - the portal associated with the permission (required)
        Returns:
        the matching permission object
        Since:
        5.1.0
      • getPermissionsForPortal

        public List<Permission> getPermissionsForPortal​(String portalId)
        Return all permissions for a specific portal, ordered by name
        Parameters:
        portalId - the OID of the portal
        Returns:
        the list of permissions
      • getPermissionsForPortalName

        public List<Permission> getPermissionsForPortalName​(String portalName)
        Return all permissions for a specific portal, ordered by name
        Parameters:
        portalName - the portal name
        Returns:
        the list of permissions
      • getPermissionNamesForRolePortal

        public Set<String> getPermissionNamesForRolePortal​(String roleName,
                                                           String portalId)
        Return the set of permissions for a Role on a given portal
        Parameters:
        roleName - the name of a role
        portalId - the Id of a portal
        Returns:
        the set of permission names that are assigned to the user for the given portal
      • loadDefaultPermissions

        public void loadDefaultPermissions()
        Load the pre-defined system permissions
      • purgeObsoleteValues

        public void purgeObsoleteValues()
        Purge obsolete permissions from the database. Will only remove permissions associated with the administration console.