Package com.avoka.fc.core.dao
Class PermissionDao
- java.lang.Object
-
- com.avoka.core.dao.BaseDao
-
- com.avoka.fc.core.dao.AbstractDao
-
- com.avoka.fc.core.dao.PermissionDao
-
public class PermissionDao extends AbstractDao
Provides a DAO for the Permission entity.- See Also:
Permission
-
-
Field Summary
-
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description PermissionDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Permission
getPermission(Object id)
Return the permission with the specified OIDPermission
getPermissionByName(String name, String portalId)
Return the permission with the given namePermission
getPermissionByNameAndPortal(String name, Portal portal)
Return the permission with the given name belonging to the portal with the given namePermission
getPermissionByNameAndPortal(String name, String portalName)
Return the permission with the given name belonging to the portal with the given nameSet<String>
getPermissionNamesForRolePortal(String roleName, String portalId)
Return the set of permissions for a Role on a given portalList<Permission>
getPermissionsForPortal(String portalId)
Return all permissions for a specific portal, ordered by nameList<Permission>
getPermissionsForPortalName(String portalName)
Return all permissions for a specific portal, ordered by namevoid
loadDefaultPermissions()
Load the pre-defined system permissionsvoid
purgeObsoleteValues()
Purge obsolete permissions from the database.-
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
-
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 permissionportalId
- 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 permissionportalName
- 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 roleportalId
- 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.
-
-