|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PermissionAPI
| 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 int |
PERMISSION_USE
|
static int |
PERMISSION_WRITE
|
| 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 |
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 |
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 |
|
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<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 |
|
void |
mapAllPermissions()
Get a map of all the permission that live page have |
|
int |
maskOfAllPermissions()
Returns the bit mask of all system permissions |
|
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 |
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_USE
static final int PERMISSION_EDIT
static final int PERMISSION_READ
static final int PERMISSION_WRITE
static final int PERMISSION_PUBLISH
static final int PERMISSION_EDIT_PERMISSIONS
static final int PERMISSION_CREATE_VIRTUAL_LINKS
static final int PERMISSION_CAN_ADD_CHILDREN
static final java.lang.String INDIVIDUAL_PERMISSION_TYPE
| 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> 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
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||