Package com.avoka.fc.core.dao
Class RoleDao
- java.lang.Object
-
- com.avoka.core.dao.BaseDao
-
- com.avoka.fc.core.dao.AbstractDao
-
- com.avoka.fc.core.dao.RoleDao
-
public class RoleDao extends AbstractDao
Provides a DAO for the Role entity.- See Also:
Role
-
-
Field Summary
-
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description RoleDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Role
assignDefaultAnonymousPermissions()
Create the pre-defined anonymous role (unless a role with the name defined inRole.ANONYMOUS_ROLE
already exists) and assigns it all permissions associated with the Anonymous Rolevoid
assignDefaultPermissions()
Create the pre-defined root administrator role (unless a role with the name defined inRole.ADMINISTRATOR_ROLE
already exists) and assigns it all permissions associated with the Administration ConsoleRole
assignDefaultServiceUserPermissions()
Create the pre-defined service role (unless a role with the name defined inRole.SERVICE_USER_ROLE
already exists) and assigns it all permissions associated with the Service User RoleList<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.List<UserRole>
getGlobalRolesForAdmin(String userId)
Return all non-client assignable user roles associated with the given user accountRole
getRole(Object id)
Return the role with the specified OIDRole
getRoleForName(String name)
Return the role with the specified nameList<Role>
getRoleList(UserAccount userAccount, String keyword, boolean activeOnly)
Return the list of roles matching the specified search criteria, ordered by nameList<Role>
getRoleList(UserAccount userAccount, String keyword, Object portalId, boolean activeOnly)
Return the list of roles matching the specified search criteria, ordered by nameList<Role>
getRoles()
Return all roles, ordered by name-
Methods inherited from class com.avoka.fc.core.dao.AbstractDao
andFilterClientExcludeNull, andFilterClientIncludeNull, andFilterClientOnly, isClientAccessAllowed, performQueryConfigCached
-
Methods inherited from class com.avoka.core.dao.BaseDao
addOrdering, addOrderingCaseInsensitive, addOrderingCaseSensitive, andQueryBetween, andQueryInExp, andQueryInExp, andQueryLikeIgnoreCaseExp, andQueryMatchDbExp, andQueryMatchExp, andQueryMatchIsNotNull, andQueryMatchIsNull, andQueryNoMatchExp, andQueryNotTrue, deleteObject, deleteObjects, findObject, getDataContext, getFetchLimit, getLogger, getObjectForPK, newObject, orQueryLikeIgnoreCaseExp, orQueryMatchExp, performNamedQuery, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, performQuery, registerNewObject, setCacheStrategy, setFetchLimit, setLocalCacheStrategy, setLocalCacheStrategy, setSharedCacheStrategy, toMap, toMap
-
-
-
-
Method Detail
-
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 accountkeyword
- the search keywordactiveOnly
- 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 accountkeyword
- the search keywordportalId
- the portalIdactiveOnly
- 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 inRole.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 inRole.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 inRole.SERVICE_USER_ROLE
already exists) and assigns it all permissions associated with the Service User Role- Since:
- 21.11.0
-
-