use of org.camunda.bpm.engine.authorization.Permission in project camunda-bpm-platform by camunda.
the class DefaultAuthorizationProvider method createGrantAuthorization.
protected AuthorizationEntity createGrantAuthorization(String userId, String groupId, Resource resource, String resourceId, Permission... permissions) {
// assuming that there are no default authorizations for *
if (userId != null) {
ensureValidIndividualResourceId("Cannot create authorization for user " + userId, userId);
}
if (groupId != null) {
ensureValidIndividualResourceId("Cannot create authorization for group " + groupId, groupId);
}
AuthorizationEntity authorization = new AuthorizationEntity(AUTH_TYPE_GRANT);
authorization.setUserId(userId);
authorization.setGroupId(groupId);
authorization.setResource(resource);
authorization.setResourceId(resourceId);
if (permissions != null) {
for (Permission permission : permissions) {
authorization.addPermission(permission);
}
}
return authorization;
}
use of org.camunda.bpm.engine.authorization.Permission in project camunda-bpm-platform by camunda.
the class LdapUserQueryTest method createGrantAuthorization.
protected void createGrantAuthorization(Resource resource, String resourceId, String userId, Permission... permissions) {
Authorization authorization = createAuthorization(AUTH_TYPE_GRANT, resource, resourceId);
authorization.setUserId(userId);
for (Permission permission : permissions) {
authorization.addPermission(permission);
}
authorizationService.saveAuthorization(authorization);
}
use of org.camunda.bpm.engine.authorization.Permission in project camunda-bpm-platform by camunda.
the class LdapDisableAuthorizationCheckTest method createGrantAuthorization.
protected void createGrantAuthorization(Resource resource, String resourceId, String userId, Permission... permissions) {
Authorization authorization = createAuthorization(AUTH_TYPE_GRANT, resource, resourceId);
authorization.setUserId(userId);
for (Permission permission : permissions) {
authorization.addPermission(permission);
}
authorizationService.saveAuthorization(authorization);
}
use of org.camunda.bpm.engine.authorization.Permission in project camunda-bpm-platform by camunda.
the class GroupAuthorizationTest method createGroupGrantAuthorization.
protected void createGroupGrantAuthorization(Resource resource, String resourceId, String groupId, Permission... permissions) {
Authorization authorization = createGrantAuthorization(resource, resourceId);
authorization.setGroupId(groupId);
for (Permission permission : permissions) {
authorization.addPermission(permission);
}
saveAuthorization(authorization);
}
use of org.camunda.bpm.engine.authorization.Permission in project camunda-bpm-platform by camunda.
the class AuthorizationTest method createRevokeAuthorization.
protected void createRevokeAuthorization(Resource resource, String resourceId, String userId, Permission... permissions) {
Authorization authorization = createRevokeAuthorization(resource, resourceId);
authorization.setUserId(userId);
for (Permission permission : permissions) {
authorization.removePermission(permission);
}
saveAuthorization(authorization);
}
Aggregations