|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PermissionAPI
| Nested Class Summary | |
|---|---|
static class |
PermissionAPI.PermissionableType
|
| Field Summary | |
|---|---|
static java.lang.String |
INDIVIDUAL_PERMISSION_TYPE
|
static int |
PERMISSION_CAN_ADD_CHILDREN
|
static int |
PERMISSION_CREATE_VIRTUAL_LINKS
|
static int |
PERMISSION_EDIT
|
static int |
PERMISSION_EDIT_PERMISSIONS
|
static int |
PERMISSION_PUBLISH
|
static int |
PERMISSION_READ
|
static java.lang.String[] |
PERMISSION_TYPES
|
static int |
PERMISSION_USE
|
static int |
PERMISSION_WRITE
|
static java.util.Map<java.lang.String,java.lang.String> |
permissionTypes
|
| Method Summary | ||
|---|---|---|
void |
assignPermissions(java.util.List<Permission> permission,
Permissionable permissionable,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
Assigns a set of permissions to a given asset, any permissions already assigned to the asset are either updated or removed to match the provided list |
|
void |
cascadePermissionUnder(Permissionable permissionable,
Role role)
Navigates through the given permissionable children making sure all individual permissioned assets also have the same permission rules for the given role as the parent permissionable has. |
|
void |
clearCache()
This method is to clear the permissions cache. |
|
void |
copyPermissions(Permissionable from,
Permissionable to)
copies permissions from one permissionable to another |
|
boolean |
doesRoleHavePermission(Permissionable permissionable,
int permissionType,
Role role)
Return true if the role has permission over the permissionable the specified permission |
|
boolean |
doesRoleHavePermission(Permissionable permissionable,
int permissionType,
Role role,
boolean respectFrontendRoles)
Deprecated. respectFrontendRoles parameter does not makes sense and its been totally ignored. @see doesRoleHavePermission(Permissionable,int,Role) |
|
boolean |
doesUserHaveInheriablePermissions(Permissionable parent,
java.lang.String type,
int requiredPermissions,
com.liferay.portal.model.User user)
Returns if a user has proper permissions to an asset - even if not created yet based on the Permissionable parent. |
|
boolean |
doesUserHavePermission(Permissionable permissionable,
int permissionType,
com.liferay.portal.model.User user)
Return true if the user have over the permissionable the specified permission This method is meant to be used by frontend call because assumes that frontend roles should respected |
|
boolean |
doesUserHavePermission(Permissionable permissionable,
int permissionType,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
Return true if the user have over the permissionable the specified permission |
|
boolean |
doesUserHavePermissions(Permissionable permissionable,
java.lang.String requiredPermissions,
com.liferay.portal.model.User user)
Returns true if the user has the requiredPermissions over the specified permissionable this method is meant to be used to check multiple parent & children permissions on Hosts/Folders. |
|
boolean |
doesUserHavePermissions(Permissionable permissionable,
java.lang.String requiredPermissions,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
Returns true if the user has the requiredPermissions over the specified permissionable this method is meant to be used to check multiple parent & children permissions on Hosts/Folders. |
|
boolean |
doesUserHavePermissions(PermissionAPI.PermissionableType permType,
int permissionType,
com.liferay.portal.model.User user)
Returns true if the user has the requiredPermissions over the specified objectType this method is meant to be used to check multiple parent & children permissions on Hosts/Folders. |
|
boolean |
doesUserOwn(Inode inode,
com.liferay.portal.model.User user)
|
|
|
filterCollection(java.util.List<P> permissionables,
int requiredPermission,
boolean respectFrontendRoles,
com.liferay.portal.model.User user)
Filters the given list of permissionables that meet the required permission mask |
|
|
filterCollectionByDBPermissionReference(java.util.List<P> permissionables,
int requiredPermission,
boolean respectFrontendRoles,
com.liferay.portal.model.User user)
Filters the given list of permissionables that meet the required permission mask using the permission reference table instead of hitting the cache This method can be slow if you pass in many objects or there are lots of objects in the DBs. |
|
Permissionable |
findParentPermissionable(Permissionable permissionable)
Finds the permissionable instance from where permissionable is inheriting its permissions. |
|
java.util.List<Permission> |
getInheritablePermissions(Permissionable permissionable)
Retrieves the list of permission that could be inherited from the given parent permissionable, |
|
java.util.List<Permission> |
getInheritablePermissions(Permissionable permissionable,
boolean bitPermissions)
Retrieves the list of permission that could be inherited from the given parent permissionable |
|
java.util.List<Permission> |
getInheritablePermissionsRecurse(Permissionable permissionable)
Retrieves the list of ALL permission that could be inherited from the given parent and the parent's parent and so on until it hits the system_host |
|
java.util.List<java.lang.Integer> |
getPermissionIdsFromRoles(Permissionable permissionable,
Role[] roles,
com.liferay.portal.model.User user)
Retrieves the granted permissions for a given list of roles, E.G. |
|
java.util.List<java.lang.Integer> |
getPermissionIdsFromUser(Permissionable permissionable,
com.liferay.portal.model.User user)
Retrieves the granted permissions for a given user, E.G. |
|
java.util.List<Permission> |
getPermissions(Permissionable permissionable)
Retrieves the list of permissions associated to the given permissionable, either searching from individual permissions directly associated or permissions inheriting from a parent This method returns permissions in the old format and not the compressed bit permissions format. |
|
java.util.List<Permission> |
getPermissions(Permissionable permissionable,
boolean bitPermissions)
Retrieves the list of permissions associated to the given permissionable, either searching from individual permissions directly associated or permissions inheriting from a parent If bitPermissions is set true this methods returns the permissions in the new bit compressed format so multiple permissions for the same role will be returned in one permission entry. |
|
java.util.List<Permission> |
getPermissions(Permissionable permissionable,
boolean bitPermissions,
boolean onlyIndividualPermissions)
Retrieves the list of permissions associated to the given permissionable, either searching from individual permissions directly associated or permissions inheriting from a parent |
|
java.util.List<Permission> |
getPermissions(Permissionable permissionable,
boolean bitPermissions,
boolean onlyIndividualPermissions,
boolean forceLoadFromDB)
Retrieves the list of permissions associated to the given permissionable, either searching from individual permissions directly associated or permissions inheriting from a parent |
|
java.util.List<Permission> |
getPermissionsByRole(Role role,
boolean onlyFoldersAndHosts)
Retrieves all permissions associated to a given a role, includes individual and inheritable permissions |
|
java.util.List<Permission> |
getPermissionsByRole(Role role,
boolean onlyFoldersAndHosts,
boolean bitPermissions)
Retrieves all permissions associated to a given a role, includes individual and inheritable permissions |
|
java.util.Map<java.lang.String,java.lang.Integer> |
getPermissionTypes()
This method returns all the permission type masks configured in the system |
|
java.util.Set<Role> |
getPublishRoles(Permissionable permissionable)
Deprecated. PermissionAPI.getRolesWithPermission |
|
java.util.Set<Role> |
getReadRoles(Permissionable permissionable)
Deprecated. PermissionAPI.getRolesWithPermission |
|
java.util.Set<com.liferay.portal.model.User> |
getReadUsers(Permissionable permissionable)
Deprecated. PermissionAPI.getUsersWithPermission |
|
int |
getRoleCount(java.lang.String permissionable,
int permissionType,
java.lang.String filter)
Retrieves the count of roles associated with the given permissionable that poses permissionType access and filters them by name This method is intended for backend usage is does not check for frontend specific roles like cms anon o logged in site user |
|
int |
getRoleCount(java.lang.String permissionable,
int permissionType,
java.lang.String filter,
boolean hideSystemRoles)
Retrieves the count of roles associated with the given permissionable that poses permissionType access and filters them by name This method is intended for backend usage is does not check for frontend specific roles like cms anon o logged in site user |
|
java.util.List<Role> |
getRoles(java.lang.String permissionable,
int permissionType,
java.lang.String filter,
int start,
int limit)
Retrieves the roles associated with the given permissionable that poses permissionType access and filters them by name This method is intended for backend usage is does not check for frontend specific roles like cms anon o logged in site user |
|
java.util.List<Role> |
getRoles(java.lang.String permissionable,
int permissionType,
java.lang.String filter,
int start,
int limit,
boolean hideSystemRoles)
Retrieves the roles associated with the given permissionable that poses permissionType access and filters them by name This method is intended for backend usage is does not check for frontend specific roles like cms anon o logged in site user |
|
java.util.Set<Role> |
getRolesWithPermission(Permissionable permissionable,
int permission)
Retrieves the list of roles that have the given permission granted on the permissionable |
|
int |
getUserCount(java.lang.String permissionable,
int permissionType,
java.lang.String filter)
Retrieves the count of users with the given permissionType access to the given permissionable and filter the user names based on the given filter This method is intended for backend usage is does not check for frontend specific roles like cms anon o logged in site user |
|
java.util.List<com.liferay.portal.model.User> |
getUsers(java.lang.String permissionable,
int permissionType,
java.lang.String filter,
int start,
int limit)
Retrieves the users with the given permissionType access to the given permissionable and filter the user names based on the given filter. |
|
java.util.Set<com.liferay.portal.model.User> |
getUsersWithPermission(Permissionable permissionable,
int permission)
Retrieves the list of users that have the given permission granted on the permissionable |
|
java.util.Set<Role> |
getWriteRoles(Permissionable permissionable)
Deprecated. PermissionAPI.getRolesWithPermission |
|
java.util.Set<com.liferay.portal.model.User> |
getWriteUsers(Permissionable permissionable)
Deprecated. PermissionAPI.getUsersWithPermission |
|
boolean |
isInheritingPermissions(Permissionable permissionable)
Returns wherever a permissionable is inheriting its permissions or have individual permissions |
|
void |
mapAllPermissions()
Get a map of all the permission that live page have |
|
int |
maskOfAllPermissions()
Returns the bit mask of all system permissions |
|
void |
permissionIndividually(Permissionable parent,
Permissionable permissionable,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
|
|
void |
removePermissions(Permissionable permissionable)
Remove all individual permissions attached to the asset |
|
void |
removePermissionsByRole(java.lang.String roleId)
Remove all the permissions given the roleId |
|
void |
resetAllPermissionReferences()
Removes all permission references |
|
void |
resetChildrenPermissionReferences(Structure structure)
Removes the permission references of all content children of the given structure |
|
void |
resetPermissionReferences(Permissionable perm)
Removes the given permissionable permission references forcing the api to recalculate the reference |
|
void |
resetPermissionsUnder(Permissionable parent)
Recursively removes all individual and inheritable permissions of children of the given permissionable |
|
void |
save(Permission permission,
Permissionable permissionable,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
Saves an individual permission of a given permissionable |
|
void |
setDefaultCMSAdminPermissions(Permissionable permissionable)
Sets the to the CMS_ADMINISTRATOR_ROLE permission over the permissionable |
|
void |
setDefaultCMSAnonymousPermissions(Permissionable permissionable)
Sets reads the to the CMS_ANONYMOUS_ROLE permission over the permissionable |
|
void |
updateOwner(Permissionable asset,
java.lang.String ownerId)
This method updates the given permissionable owner with the given user id |
|
| Field Detail |
|---|
static final int PERMISSION_READ
static final int PERMISSION_USE
static final int PERMISSION_EDIT
static final int PERMISSION_WRITE
static final int PERMISSION_PUBLISH
static final int PERMISSION_EDIT_PERMISSIONS
static final int PERMISSION_CAN_ADD_CHILDREN
static final int PERMISSION_CREATE_VIRTUAL_LINKS
static final java.lang.String[] PERMISSION_TYPES
static final java.lang.String INDIVIDUAL_PERMISSION_TYPE
static final java.util.Map<java.lang.String,java.lang.String> permissionTypes
| Method Detail |
|---|
java.util.Map<java.lang.String,java.lang.Integer> getPermissionTypes()
boolean doesRoleHavePermission(Permissionable permissionable,
int permissionType,
Role role,
boolean respectFrontendRoles)
throws DotDataException
permissionable - permissionType - role -
DotDataException
boolean doesRoleHavePermission(Permissionable permissionable,
int permissionType,
Role role)
throws DotDataException
permissionable - permissionType - role -
DotDataException
boolean doesUserHavePermission(Permissionable permissionable,
int permissionType,
com.liferay.portal.model.User user)
throws DotDataException
o - permissionablepermissionId - user -
DotDataException
boolean doesUserHavePermission(Permissionable permissionable,
int permissionType,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
throws DotDataException
o - permissionablepermissionId - user - respectFrontendRoles -
DotDataException
void removePermissions(Permissionable permissionable)
throws DotDataException
o - permissionable
DotDataException
void setDefaultCMSAdminPermissions(Permissionable permissionable)
throws DotDataException
permissionable -
DotDataException
void setDefaultCMSAnonymousPermissions(Permissionable permissionable)
throws DotDataException
permissionable -
DotDataException
void copyPermissions(Permissionable from,
Permissionable to)
throws DotDataException
from - permissionableto - permissionable
DotDataException
java.util.List<Permission> getPermissions(Permissionable permissionable)
throws DotDataException
permissionable -
DotDataException
java.util.List<Permission> getPermissions(Permissionable permissionable,
boolean bitPermissions)
throws DotDataException
permissionable - bitPermissions - if true returns the new compressed bit permissions format, where multiple permissions can be stored
in a single permission object
DotDataException
java.util.List<Permission> getPermissions(Permissionable permissionable,
boolean bitPermissions,
boolean onlyIndividualPermissions)
throws DotDataException
permissionable - bitPermissions - if true returns the new compressed bit permissions format, where multiple permissions can be stored
in a single permission objectonlyIndividualPermissions - If true it will only look for individually set permissions in the asset and not try to go and
search through the chain of permissions inheritance
DotDataException
java.util.List<Permission> getPermissions(Permissionable permissionable,
boolean bitPermissions,
boolean onlyIndividualPermissions,
boolean forceLoadFromDB)
throws DotDataException
permissionable - bitPermissions - if true returns the new compressed bit permissions format, where multiple permissions can be stored
in a single permission objectonlyIndividualPermissions - If true it will only look for individually set permissions in the asset and not try to go and
search through the chain of permissions inheritanceforceLoadFromDB - Forces to load from DB
DotDataException
java.util.List<Permission> getInheritablePermissions(Permissionable permissionable)
throws DotDataException
permissionable -
DotDataException
java.util.List<Permission> getInheritablePermissionsRecurse(Permissionable permissionable)
throws DotDataException
permissionable -
DotDataException
java.util.List<Permission> getInheritablePermissions(Permissionable permissionable,
boolean bitPermissions)
throws DotDataException
permissionable - bitPermissions - if true the compact bit version of permissions will be returned
DotDataException
java.util.Set<Role> getReadRoles(Permissionable permissionable)
throws DotDataException
PermissionAPI.getRolesWithPermission
o - permissionable to get read roles for
DotDataException
java.util.Set<com.liferay.portal.model.User> getReadUsers(Permissionable permissionable)
throws DotDataException
PermissionAPI.getUsersWithPermission
o - permissionable to get read roles for
DotDataException
java.util.Set<Role> getPublishRoles(Permissionable permissionable)
throws DotDataException
PermissionAPI.getRolesWithPermission
o - permissionable to get read roles for
DotDataException
java.util.Set<Role> getWriteRoles(Permissionable permissionable)
throws DotDataException
PermissionAPI.getRolesWithPermission
o - permissionable to get read roles for
DotDataException
java.util.Set<com.liferay.portal.model.User> getWriteUsers(Permissionable permissionable)
throws DotDataException
PermissionAPI.getUsersWithPermission
o - permissionable to get read roles for
DotDataException
java.util.Set<Role> getRolesWithPermission(Permissionable permissionable,
int permission)
throws DotDataException
permissionable - permission -
DotDataException
java.util.Set<com.liferay.portal.model.User> getUsersWithPermission(Permissionable permissionable,
int permission)
throws DotDataException
permissionable - permission -
DotDataException
boolean doesUserOwn(Inode inode,
com.liferay.portal.model.User user)
throws DotDataException
inode - The inode to look foruser - The user to check against
DotDataException
void mapAllPermissions()
throws DotDataException
DotDataException
java.util.List<java.lang.Integer> getPermissionIdsFromRoles(Permissionable permissionable,
Role[] roles,
com.liferay.portal.model.User user)
throws DotDataException
permissionable - roles -
DotDataException
java.util.List<java.lang.Integer> getPermissionIdsFromUser(Permissionable permissionable,
com.liferay.portal.model.User user)
throws DotDataException
permissionable - roles -
DotDataException
java.util.List<Role> getRoles(java.lang.String permissionable,
int permissionType,
java.lang.String filter,
int start,
int limit)
permissionable - permissionType - filter - start - limit -
java.util.List<Role> getRoles(java.lang.String permissionable,
int permissionType,
java.lang.String filter,
int start,
int limit,
boolean hideSystemRoles)
permissionable - permissionType - filter - start - limit -
int getRoleCount(java.lang.String permissionable,
int permissionType,
java.lang.String filter)
permissionable - permissionType - filter -
int getRoleCount(java.lang.String permissionable,
int permissionType,
java.lang.String filter,
boolean hideSystemRoles)
permissionable - permissionType - filter -
java.util.List<com.liferay.portal.model.User> getUsers(java.lang.String permissionable,
int permissionType,
java.lang.String filter,
int start,
int limit)
permissionable - permissionType - filter - start - limit -
int getUserCount(java.lang.String permissionable,
int permissionType,
java.lang.String filter)
permissionable - permissionType - filter -
java.util.List<Permission> getPermissionsByRole(Role role,
boolean onlyFoldersAndHosts)
throws DotDataException
role - onlyFoldersAndHosts - filters for only permissions assigned to folders and hosts
DotDataException
java.util.List<Permission> getPermissionsByRole(Role role,
boolean onlyFoldersAndHosts,
boolean bitPermissions)
throws DotDataException
role - onlyFoldersAndHosts - filters for only permissions assigned to folders and hosts
DotDataException
<P extends Permissionable> java.util.List<P> filterCollection(java.util.List<P> permissionables,
int requiredPermission,
boolean respectFrontendRoles,
com.liferay.portal.model.User user)
throws DotDataException,
DotSecurityException
P - The type of permissionable given to the methodpermissionables - requiredPermission - respectFrontendRoles - user -
DotDataException
DotSecurityException
<P extends Permissionable> java.util.List<P> filterCollectionByDBPermissionReference(java.util.List<P> permissionables,
int requiredPermission,
boolean respectFrontendRoles,
com.liferay.portal.model.User user)
throws DotDataException,
DotSecurityException
P - The type of permissionable given to the methodpermissionables - requiredPermission - respectFrontendRoles - user -
DotDataException
DotSecurityExceptionvoid removePermissionsByRole(java.lang.String roleId)
roleId -
void save(Permission permission,
Permissionable permissionable,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
throws DotDataException,
DotSecurityException
permission - permissionable -
DotDataException
DotSecurityException
void assignPermissions(java.util.List<Permission> permission,
Permissionable permissionable,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
throws DotDataException,
DotSecurityException
permission - permissionable -
DotDataException
DotSecurityExceptionvoid clearCache()
void updateOwner(Permissionable asset,
java.lang.String ownerId)
throws DotDataException
asset - ownerId -
DotDataExceptionint maskOfAllPermissions()
void resetPermissionsUnder(Permissionable parent)
throws DotDataException
parent -
DotDataException
void cascadePermissionUnder(Permissionable permissionable,
Role role)
throws DotDataException
permissionable - role -
DotDataException
void resetPermissionReferences(Permissionable perm)
throws DotDataException
perm -
DotDataException
void resetChildrenPermissionReferences(Structure structure)
throws DotDataException
perm -
DotDataException
void resetAllPermissionReferences()
throws DotDataException
DotDataException
boolean doesUserHaveInheriablePermissions(Permissionable parent,
java.lang.String type,
int requiredPermissions,
com.liferay.portal.model.User user)
throws DotDataException
parent - type - requiredPermissions - user -
DotDataException
boolean doesUserHavePermissions(Permissionable permissionable,
java.lang.String requiredPermissions,
com.liferay.portal.model.User user)
throws DotDataException
permissionable - requiredPermissions - a comma separated list of permissions of the form TYPE:PERMISSION, where TYPE is the permission type
to match the permission against the permissions under the given permissionable host or folder.If no children permissionable are given
the TYPE should be set to PARENT i.e : PARENT:1, this will check for READ permissions on the given permissionable while a value of
PARENT:1, STRUCTURES:4 will check for READ permissions on the given permissionable AND publish permission on structures under the
given permissionable.user -
DotDataException
boolean doesUserHavePermissions(Permissionable permissionable,
java.lang.String requiredPermissions,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
throws DotDataException
permissionable - requiredPermissions - a comma separated list of permissions of the form TYPE:PERMISSION, where TYPE is the permission type
to match the permission against the permissions under the given permissionable host or folder.If no children permissionable are given
the TYPE should be set to PARENT i.e : PARENT:1, this will check for READ permissions on the given permissionable while a value of
PARENT:1, STRUCTURES:4 will check for READ permissions on the given permissionable AND publish permission on structures under the
given permissionable.user - respectFrontendRoles -
DotDataException
boolean doesUserHavePermissions(PermissionAPI.PermissionableType permType,
int permissionType,
com.liferay.portal.model.User user)
throws DotDataException
objectyType - requiredPermissions - a comma separated list of permissions of the form TYPE:PERMISSION, where TYPE is the permission type
to match the permission against the permissions under the given permissionable host or folder.If no children permissionable are given
the TYPE should be set to PARENT i.e : PARENT:1, this will check for READ permissions on the given permissionable while a value of
PARENT:1, STRUCTURES:4 will check for READ permissions on the given permissionable AND publish permission on structures under the
given permissionable.user -
DotDataException
void permissionIndividually(Permissionable parent,
Permissionable permissionable,
com.liferay.portal.model.User user,
boolean respectFrontendRoles)
throws DotDataException,
DotSecurityException
parent - permissionable - user - respectFrontendRoles -
DotDataException
DotSecurityException
Permissionable findParentPermissionable(Permissionable permissionable)
throws DotDataException,
DotSecurityException
permissionable is inheriting its permissions.
It is usefull before call permissionIndividually as it requires both the permissionable and the parent
from where it inherits its permissions
http://jira.dotmarketing.net/browse/DOTCMS-6316
permissionable -
DotDataException
DotSecurityException
boolean isInheritingPermissions(Permissionable permissionable)
throws DotDataException
permissionable -
DotDataException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||