@ProviderType @Transactional(isolation=PORTAL, rollbackFor={PortalException.class,SystemException.class}) public interface ResourcePermissionLocalService extends BaseLocalService, PersistedModelLocalService
ResourcePermissionLocalServiceUtil
Modifier and Type | Method and Description |
---|---|
void |
addModelResourcePermissions(AuditedModel auditedModel,
ServiceContext serviceContext)
NOTE FOR DEVELOPERS:
Never modify or reference this interface directly.
|
void |
addModelResourcePermissions(long companyId,
long groupId,
long userId,
String name,
String primKey,
ModelPermissions modelPermissions) |
void |
addModelResourcePermissions(long companyId,
long groupId,
long userId,
String name,
String primKey,
String[] groupPermissions,
String[] guestPermissions)
Adds resources for the model with the name and primary key string, always
creating a resource at the individual scope and only creating resources
at the group, group template, and company scope if such resources don't
already exist.
|
void |
addResourcePermission(long companyId,
String name,
int scope,
String primKey,
long roleId,
String actionId)
Grants the role permission at the scope to perform the action on
resources of the type.
|
ResourcePermission |
addResourcePermission(ResourcePermission resourcePermission)
Adds the resource permission to the database.
|
void |
addResourcePermissions(long companyId,
long groupId,
long userId,
String name,
String primKey,
boolean portletActions,
boolean addGroupPermissions,
boolean addGuestPermissions)
Adds resources for the entity with the name and primary key string,
always creating a resource at the individual scope and only creating
resources at the group, group template, and company scope if such
resources don't already exist.
|
void |
addResourcePermissions(String resourceName,
String roleName,
int scope,
long resourceActionBitwiseValue)
Grants the role permissions at the scope to perform the actions on all
resources of the type.
|
void |
copyModelResourcePermissions(long companyId,
String name,
long oldPrimKey,
long newPrimKey) |
ResourcePermission |
createResourcePermission(long resourcePermissionId)
Creates a new resource permission with the primary key.
|
PersistedModel |
deletePersistedModel(PersistedModel persistedModel) |
ResourcePermission |
deleteResourcePermission(long resourcePermissionId)
Deletes the resource permission with the primary key from the database.
|
ResourcePermission |
deleteResourcePermission(ResourcePermission resourcePermission)
Deletes the resource permission from the database.
|
void |
deleteResourcePermissions(long companyId,
String name,
int scope,
long primKey)
Deletes all resource permissions at the scope to resources of the type.
|
void |
deleteResourcePermissions(long companyId,
String name,
int scope,
String primKey)
Deletes all resource permissions at the scope to resources of the type.
|
DynamicQuery |
dynamicQuery() |
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows.
|
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
Performs a dynamic query on the database and returns a range of the matching rows.
|
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<T> orderByComparator)
Performs a dynamic query on the database and returns an ordered range of the matching rows.
|
long |
dynamicQueryCount(DynamicQuery dynamicQuery)
Returns the number of rows matching the dynamic query.
|
long |
dynamicQueryCount(DynamicQuery dynamicQuery,
Projection projection)
Returns the number of rows matching the dynamic query.
|
ResourcePermission |
fetchResourcePermission(long resourcePermissionId) |
ResourcePermission |
fetchResourcePermission(long companyId,
String name,
int scope,
String primKey,
long roleId) |
ActionableDynamicQuery |
getActionableDynamicQuery() |
Map<Long,Set<String>> |
getAvailableResourcePermissionActionIds(long companyId,
String name,
int scope,
String primKey,
Collection<String> actionIds) |
List<String> |
getAvailableResourcePermissionActionIds(long companyId,
String name,
int scope,
String primKey,
long roleId,
Collection<String> actionIds)
Returns the intersection of action IDs the role has permission at the
scope to perform on resources of the type.
|
IndexableActionableDynamicQuery |
getIndexableActionableDynamicQuery() |
String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
PersistedModel |
getPersistedModel(Serializable primaryKeyObj) |
ResourcePermission |
getResourcePermission(long resourcePermissionId)
Returns the resource permission with the primary key.
|
ResourcePermission |
getResourcePermission(long companyId,
String name,
int scope,
String primKey,
long roleId)
Returns the resource permission for the role at the scope to perform the
actions on resources of the type.
|
List<ResourcePermission> |
getResourcePermissions(int start,
int end)
Returns a range of all the resource permissions.
|
List<ResourcePermission> |
getResourcePermissions(long companyId,
String name,
int scope,
String primKey)
Returns all the resource permissions at the scope of the type.
|
int |
getResourcePermissionsCount()
Returns the number of resource permissions.
|
int |
getResourcePermissionsCount(long companyId,
String name,
int scope,
String primKey)
Returns the number of resource permissions at the scope of the type.
|
List<ResourcePermission> |
getResourceResourcePermissions(long companyId,
long groupId,
String name,
String primKey)
Returns the resource permissions that apply to the resource.
|
List<ResourcePermission> |
getRoleResourcePermissions(long roleId)
Returns all the resource permissions for the role.
|
List<ResourcePermission> |
getRoleResourcePermissions(long roleId,
int[] scopes,
int start,
int end)
Returns a range of all the resource permissions for the role at the
scopes.
|
List<Role> |
getRoles(long companyId,
String name,
int scope,
String primKey,
String actionId) |
List<ResourcePermission> |
getScopeResourcePermissions(int[] scopes)
Returns all the resource permissions where scope = any ?.
|
boolean |
hasActionId(ResourcePermission resourcePermission,
ResourceAction resourceAction)
Returns
true if the resource permission grants permission to
perform the resource action. |
boolean |
hasResourcePermission(List<Resource> resources,
long[] roleIds,
String actionId)
Returns
true if the roles have permission at the scope to
perform the action on the resources. |
boolean |
hasResourcePermission(long companyId,
String name,
int scope,
String primKey,
long[] roleIds,
String actionId)
Returns
true if the roles have permission at the scope to
perform the action on resources of the type. |
boolean |
hasResourcePermission(long companyId,
String name,
int scope,
String primKey,
long roleId,
String actionId)
Returns
true if the role has permission at the scope to
perform the action on resources of the type. |
boolean |
hasScopeResourcePermission(long companyId,
String name,
int scope,
long roleId,
String actionId)
Returns
true if the role has permission at the scope to
perform the action on the resource. |
void |
initPortletDefaultPermissions(Portlet portlet) |
void |
mergePermissions(long fromRoleId,
long toRoleId)
Reassigns all the resource permissions from the source role to the
destination role, and deletes the source role.
|
void |
reassignPermissions(long resourcePermissionId,
long toRoleId)
Grants the role default permissions to all the resources of the type and
at the scope stored in the resource permission, deletes the resource
permission, and deletes the resource permission's role if it has no
permissions remaining.
|
void |
removeResourcePermission(long companyId,
String name,
int scope,
String primKey,
long roleId,
String actionId)
Revokes permission at the scope from the role to perform the action on
resources of the type.
|
void |
removeResourcePermissions(long companyId,
String name,
int scope,
long roleId,
String actionId)
Revokes all permissions at the scope from the role to perform the action
on resources of the type.
|
void |
setOwnerResourcePermissions(long companyId,
String name,
int scope,
String primKey,
long roleId,
long ownerId,
String[] actionIds)
Updates the role's permissions at the scope, setting the actions that can
be performed on resources of the type, also setting the owner of any
newly created resource permissions.
|
void |
setResourcePermissions(long companyId,
String name,
int scope,
String primKey,
long roleId,
String[] actionIds)
Updates the role's permissions at the scope, setting the actions that can
be performed on resources of the type.
|
void |
setResourcePermissions(long companyId,
String name,
int scope,
String primKey,
Map<Long,String[]> roleIdsToActionIds)
Updates the role's permissions at the scope, setting the actions that can
be performed on resources of the type.
|
void |
updateModelResourcePermissions(AuditedModel auditedModel,
ServiceContext serviceContext)
Updates the resources for the model, replacing their group and guest
permissions with new ones from the service context.
|
ResourcePermission |
updateResourcePermission(ResourcePermission resourcePermission)
Updates the resource permission in the database or adds it if it does not yet exist.
|
void |
updateResourcePermissions(long companyId,
long groupId,
String name,
long primKey,
String[] groupPermissions,
String[] guestPermissions)
Updates resources matching the group, name, and primary key at the
individual scope, setting new group and guest permissions.
|
void |
updateResourcePermissions(long companyId,
long groupId,
String name,
String primKey,
ModelPermissions modelPermissions) |
void |
updateResourcePermissions(long companyId,
long groupId,
String name,
String primKey,
String[] groupPermissions,
String[] guestPermissions) |
void |
updateResourcePermissions(long companyId,
String name,
int scope,
String primKey,
String newPrimKey) |
void addModelResourcePermissions(AuditedModel auditedModel, ServiceContext serviceContext) throws PortalException
ResourcePermissionLocalServiceUtil
to access the resource permission local service. Add custom service methods to com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl
and rerun ServiceBuilder to automatically copy the method declarations to this interface.PortalException
void addModelResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, ModelPermissions modelPermissions) throws PortalException
PortalException
void addModelResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, String[] groupPermissions, String[] guestPermissions) throws PortalException
companyId
- the primary key of the portal instancegroupId
- the primary key of the groupuserId
- the primary key of the user adding the resourcesname
- a name for the resource, typically the model's class nameprimKey
- the primary key string of the model instance, optionally
an empty string if no instance existsgroupPermissions
- the group permissions to be appliedguestPermissions
- the guest permissions to be appliedPortalException
@Retry(acceptor=SQLStateAcceptor.class, properties=@Property(name="SQLSTATE",value="23")) void addResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) throws PortalException
This method cannot be used to grant individual scope permissions, but is only intended for adding permissions at the company, group, and group-template scopes. For example, this method could be used to grant a company scope permission to edit message board posts.
If a company scope permission is granted to resources that the role already had group scope permissions to, the group scope permissions are deleted. Likewise, if a group scope permission is granted to resources that the role already had company scope permissions to, the company scope permissions are deleted. Be aware that this latter behavior can result in an overall reduction in permissions for the role.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scope. This method only supports company, group, and
group-template scope.primKey
- the primary keyroleId
- the primary key of the roleactionId
- the action IDPortalException
@Indexable(type=REINDEX) ResourcePermission addResourcePermission(ResourcePermission resourcePermission)
resourcePermission
- the resource permissionvoid addResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, boolean portletActions, boolean addGroupPermissions, boolean addGuestPermissions) throws PortalException
companyId
- the primary key of the portal instancegroupId
- the primary key of the groupuserId
- the primary key of the user adding the resourcesname
- a name for the resource, which should be a portlet ID if the
resource is a portlet or the resource's class name otherwiseprimKey
- the primary key string of the resource instance,
optionally an empty string if no instance existsportletActions
- whether to associate portlet actions with the
resourceaddGroupPermissions
- whether to add group permissionsaddGuestPermissions
- whether to add guest permissionsPortalException
void addResourcePermissions(String resourceName, String roleName, int scope, long resourceActionBitwiseValue)
This method should only be used to add default permissions to existing resources en masse during upgrades or while verifying permissions. For example, this method could be used to grant site members individual scope permissions to view all blog posts.
resourceName
- the resource's name, which can be either a class name
or a portlet IDroleName
- the role's namescope
- the scoperesourceActionBitwiseValue
- the bitwise IDs of the actionsvoid copyModelResourcePermissions(long companyId, String name, long oldPrimKey, long newPrimKey) throws PortalException
PortalException
@Transactional(enabled=false) ResourcePermission createResourcePermission(long resourcePermissionId)
resourcePermissionId
- the primary key for the new resource permissionPersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
deletePersistedModel
in interface PersistedModelLocalService
PortalException
@Indexable(type=DELETE) ResourcePermission deleteResourcePermission(long resourcePermissionId) throws PortalException
resourcePermissionId
- the primary key of the resource permissionPortalException
- if a resource permission with the primary key could not be found@Indexable(type=DELETE) ResourcePermission deleteResourcePermission(ResourcePermission resourcePermission)
resourcePermission
- the resource permissionvoid deleteResourcePermissions(long companyId, String name, int scope, long primKey) throws PortalException
removeResourcePermission
methods, as its purpose is very
different. This method should only be used for deleting resource
permissions that refer to a resource when that resource is deleted. For
example this method could be used to delete all individual scope
permissions to a blog post when it is deleted.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyPortalException
void deleteResourcePermissions(long companyId, String name, int scope, String primKey) throws PortalException
removeResourcePermission
methods, as its purpose is very
different. This method should only be used for deleting resource
permissions that refer to a resource when that resource is deleted. For
example this method could be used to delete all individual scope
permissions to a blog post when it is deleted.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyPortalException
@Transactional(propagation=SUPPORTS, readOnly=true) DynamicQuery dynamicQuery()
@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic query@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.ResourcePermissionModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.ResourcePermissionModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic query@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query@Transactional(propagation=SUPPORTS, readOnly=true) ResourcePermission fetchResourcePermission(long resourcePermissionId)
@Transactional(propagation=SUPPORTS, readOnly=true) ResourcePermission fetchResourcePermission(long companyId, String name, int scope, String primKey, long roleId)
@Transactional(propagation=SUPPORTS, readOnly=true) ActionableDynamicQuery getActionableDynamicQuery()
@Transactional(propagation=SUPPORTS, readOnly=true) Map<Long,Set<String>> getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, Collection<String> actionIds)
@Transactional(propagation=SUPPORTS, readOnly=true) List<String> getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, long roleId, Collection<String> actionIds) throws PortalException
companyId
- he primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyroleId
- the primary key of the roleactionIds
- the action IDsPortalException
@Transactional(propagation=SUPPORTS, readOnly=true) IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
String getOSGiServiceIdentifier()
@Transactional(propagation=SUPPORTS, readOnly=true) PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
getPersistedModel
in interface PersistedModelLocalService
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) ResourcePermission getResourcePermission(long resourcePermissionId) throws PortalException
resourcePermissionId
- the primary key of the resource permissionPortalException
- if a resource permission with the primary key could not be found@Transactional(propagation=SUPPORTS, readOnly=true) ResourcePermission getResourcePermission(long companyId, String name, int scope, String primKey, long roleId) throws PortalException
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyroleId
- the primary key of the rolePortalException
@Transactional(propagation=SUPPORTS, readOnly=true) List<ResourcePermission> getResourcePermissions(int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.ResourcePermissionModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
start
- the lower bound of the range of resource permissionsend
- the upper bound of the range of resource permissions (not inclusive)@Transactional(propagation=SUPPORTS, readOnly=true) List<ResourcePermission> getResourcePermissions(long companyId, String name, int scope, String primKey)
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary key@Transactional(propagation=SUPPORTS, readOnly=true) int getResourcePermissionsCount()
@Transactional(propagation=SUPPORTS, readOnly=true) int getResourcePermissionsCount(long companyId, String name, int scope, String primKey)
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary key@Transactional(propagation=SUPPORTS, readOnly=true) List<ResourcePermission> getResourceResourcePermissions(long companyId, long groupId, String name, String primKey)
companyId
- the primary key of the resource's companygroupId
- the primary key of the resource's groupname
- the resource's name, which can be either a class name or a
portlet IDprimKey
- the primary key of the resource@Transactional(propagation=SUPPORTS, readOnly=true) List<ResourcePermission> getRoleResourcePermissions(long roleId)
roleId
- the primary key of the role@Transactional(propagation=SUPPORTS, readOnly=true) List<ResourcePermission> getRoleResourcePermissions(long roleId, int[] scopes, int start, int end)
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil.ALL_POS
will return the full
result set.
roleId
- the primary key of the rolescopes
- the scopesstart
- the lower bound of the range of resultsend
- the upper bound of the range of results (not inclusive)@Transactional(propagation=SUPPORTS, readOnly=true) List<Role> getRoles(long companyId, String name, int scope, String primKey, String actionId) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) List<ResourcePermission> getScopeResourcePermissions(int[] scopes)
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil.ALL_POS
will return the full
result set.
scopes
- the scopes@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasActionId(ResourcePermission resourcePermission, ResourceAction resourceAction)
true
if the resource permission grants permission to
perform the resource action. Note that this method does not ensure that
the resource permission refers to the same type of resource as the
resource action.resourcePermission
- the resource permissionresourceAction
- the resource actiontrue
if the resource permission grants permission to
perform the resource action@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasResourcePermission(List<Resource> resources, long[] roleIds, String actionId) throws PortalException
true
if the roles have permission at the scope to
perform the action on the resources.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
resources
- the resourcesroleIds
- the primary keys of the rolesactionId
- the action IDtrue
if any one of the roles has permission to
perform the action on any one of the resources;
false
otherwisePortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) throws PortalException
true
if the role has permission at the scope to
perform the action on resources of the type.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyroleId
- the primary key of the roleactionId
- the action IDtrue
if the role has permission to perform the
action on the resource; false
otherwisePortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasResourcePermission(long companyId, String name, int scope, String primKey, long[] roleIds, String actionId) throws PortalException
true
if the roles have permission at the scope to
perform the action on resources of the type.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyroleIds
- the primary keys of the rolesactionId
- the action IDtrue
if any one of the roles has permission to
perform the action on the resource; false
otherwisePortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasScopeResourcePermission(long companyId, String name, int scope, long roleId, String actionId) throws PortalException
true
if the role has permission at the scope to
perform the action on the resource.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scoperoleId
- the primary key of the roleactionId
- the action IDtrue
if the role has permission to perform the
action on the resource; false
otherwisePortalException
void initPortletDefaultPermissions(Portlet portlet) throws PortalException
PortalException
void mergePermissions(long fromRoleId, long toRoleId) throws PortalException
fromRoleId
- the primary key of the source roletoRoleId
- the primary key of the destination rolePortalException
void reassignPermissions(long resourcePermissionId, long toRoleId) throws PortalException
resourcePermissionId
- the primary key of the resource permissiontoRoleId
- the primary key of the rolePortalException
void removeResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) throws PortalException
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyroleId
- the primary key of the roleactionId
- the action IDPortalException
void removeResourcePermissions(long companyId, String name, int scope, long roleId, String actionId) throws PortalException
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scoperoleId
- the primary key of the roleactionId
- the action IDPortalException
@Retry(acceptor=SQLStateAcceptor.class, properties=@Property(name="SQLSTATE",value="23")) void setOwnerResourcePermissions(long companyId, String name, int scope, String primKey, long roleId, long ownerId, String[] actionIds) throws PortalException
This method can be used to set permissions at any scope, but it is generally only used at the individual scope. For example, it could be used to set the guest permissions on a blog post.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyroleId
- the primary key of the roleownerId
- the primary key of the owner (generally the user that
created the resource)actionIds
- the action IDs of the actionsPortalException
@Retry(acceptor=SQLStateAcceptor.class, properties=@Property(name="SQLSTATE",value="23")) void setResourcePermissions(long companyId, String name, int scope, String primKey, long roleId, String[] actionIds) throws PortalException
This method can be used to set permissions at any scope, but it is generally only used at the individual scope. For example, it could be used to set the guest permissions on a blog post.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyroleId
- the primary key of the roleactionIds
- the action IDs of the actionsPortalException
@Retry(acceptor=SQLStateAcceptor.class, properties=@Property(name="SQLSTATE",value="23")) void setResourcePermissions(long companyId, String name, int scope, String primKey, Map<Long,String[]> roleIdsToActionIds) throws PortalException
This method can be used to set permissions at any scope, but it is generally only used at the individual scope. For example, it could be used to set the guest permissions on a blog post.
Depending on the scope, the value of primKey
will have
different meanings. For more information, see ResourcePermissionImpl
.
companyId
- the primary key of the companyname
- the resource's name, which can be either a class name or a
portlet IDscope
- the scopeprimKey
- the primary keyroleIdsToActionIds
- a map of role IDs to action IDs of the actionsPortalException
void updateModelResourcePermissions(AuditedModel auditedModel, ServiceContext serviceContext) throws PortalException
auditedModel
- the model associated with the resourcesserviceContext
- the service context to be applied. Can set group
and guest permissions.PortalException
@Indexable(type=REINDEX) ResourcePermission updateResourcePermission(ResourcePermission resourcePermission)
resourcePermission
- the resource permissionvoid updateResourcePermissions(long companyId, long groupId, String name, long primKey, String[] groupPermissions, String[] guestPermissions) throws PortalException
companyId
- the primary key of the portal instancegroupId
- the primary key of the groupname
- the resource's name, which should be a portlet ID if the
resource is a portlet or the resource's class name otherwiseprimKey
- the primary key of the resource instancegroupPermissions
- the group permissions to be appliedguestPermissions
- the guest permissions to be appliedPortalException
void updateResourcePermissions(long companyId, long groupId, String name, String primKey, ModelPermissions modelPermissions) throws PortalException
PortalException
void updateResourcePermissions(long companyId, long groupId, String name, String primKey, String[] groupPermissions, String[] guestPermissions) throws PortalException
PortalException
void updateResourcePermissions(long companyId, String name, int scope, String primKey, String newPrimKey)