Class RoleDao


public class RoleDao extends AbstractDao
Provides a DAO for the Role entity.
See Also:
  • Constructor Details

    • RoleDao

      public RoleDao()
  • Method Details

    • getRole

      public Role getRole(Object id)
      Return the role with the specified OID
      Parameters:
      id - the OID
      Returns:
      the matching role, or null if not found
    • getRoleList

      public List<Role> getRoleList(UserAccount userAccount, String keyword, boolean activeOnly)
      Return the list of roles matching the specified search criteria, ordered by name
      Parameters:
      userAccount - the non-null user account
      keyword - the search keyword
      activeOnly - whether to return only active roles, or all roles
      Returns:
      the list of matching roles
    • getRoleList

      public List<Role> getRoleList(UserAccount userAccount, String keyword, Object portalId, boolean activeOnly)
      Return the list of roles matching the specified search criteria, ordered by name
      Parameters:
      userAccount - the non-null user account
      keyword - the search keyword
      portalId - the portalId
      activeOnly - whether to return only active roles, or all roles
      Returns:
      the list of matching roles
      Since:
      4.3.0
    • getRoleForName

      public Role getRoleForName(String name)
      Return the role with the specified name
      Parameters:
      name - the role name
      Returns:
      the matching role
    • getRoles

      public List<Role> getRoles()
      Return all roles, ordered by name
      Returns:
      the list of all roles, including inactive roles
    • getAssignableRolesForAdmin

      public List<Role> getAssignableRolesForAdmin(UserAccount userAccount)
      Return all roles that the given user is allowed to assign to other users, ordered by name Only active roles will be offered.
      Parameters:
      userAccount - the non-null user account
      Returns:
      the list of matching roles
    • getGlobalRolesForAdmin

      public List<UserRole> getGlobalRolesForAdmin(String userId)
      Return all non-client assignable user roles associated with the given user account
      Parameters:
      userId - the OID of an existing SmartForm Manager user
      Returns:
      the list of matching user roles
    • assignDefaultPermissions

      public void assignDefaultPermissions()
      Create the pre-defined root administrator role (unless a role with the name defined in Role.ADMINISTRATOR_ROLE already exists) and assigns it all permissions associated with the Administration Console
    • assignDefaultAnonymousPermissions

      public Role assignDefaultAnonymousPermissions()
      Create the pre-defined anonymous role (unless a role with the name defined in Role.ANONYMOUS_ROLE already exists) and assigns it all permissions associated with the Anonymous Role
      Since:
      21.11.0
    • assignDefaultServiceUserPermissions

      public Role assignDefaultServiceUserPermissions()
      Create the pre-defined service role (unless a role with the name defined in Role.SERVICE_USER_ROLE already exists) and assigns it all permissions associated with the Service User Role
      Since:
      21.11.0