Search in sources :

Example 11 with AuthorizationService

use of org.camunda.bpm.engine.AuthorizationService in project camunda-bpm-platform by camunda.

the class HistoryAuthorizationQueryPerformanceTest method createAuthorizations.

@Before
public void createAuthorizations() {
    AuthorizationService authorizationService = engine.getAuthorizationService();
    List<Authorization> auths = authorizationService.createAuthorizationQuery().list();
    for (Authorization authorization : auths) {
        authorizationService.deleteAuthorization(authorization.getId());
    }
    userGrant("test", resource, permissions);
    for (int i = 0; i < 5; i++) {
        grouptGrant("g" + i, resource, permissions);
    }
    engine.getProcessEngineConfiguration().setAuthorizationEnabled(true);
}
Also used : Authorization(org.camunda.bpm.engine.authorization.Authorization) AuthorizationService(org.camunda.bpm.engine.AuthorizationService) Before(org.junit.Before)

Example 12 with AuthorizationService

use of org.camunda.bpm.engine.AuthorizationService in project camunda-bpm-platform by camunda.

the class RepositoryAuthorizationQueryPerformanceTest method createAuthorizations.

@Before
public void createAuthorizations() {
    AuthorizationService authorizationService = engine.getAuthorizationService();
    List<Authorization> auths = authorizationService.createAuthorizationQuery().list();
    for (Authorization authorization : auths) {
        authorizationService.deleteAuthorization(authorization.getId());
    }
    userGrant("test", resource, permissions);
    for (int i = 0; i < 5; i++) {
        grouptGrant("g" + i, resource, permissions);
    }
    engine.getProcessEngineConfiguration().setAuthorizationEnabled(true);
}
Also used : Authorization(org.camunda.bpm.engine.authorization.Authorization) AuthorizationService(org.camunda.bpm.engine.AuthorizationService) Before(org.junit.Before)

Aggregations

AuthorizationService (org.camunda.bpm.engine.AuthorizationService)12 Authorization (org.camunda.bpm.engine.authorization.Authorization)9 IdentityService (org.camunda.bpm.engine.IdentityService)4 Group (org.camunda.bpm.engine.identity.Group)3 User (org.camunda.bpm.engine.identity.User)3 Before (org.junit.Before)3 Permission (org.camunda.bpm.engine.authorization.Permission)2 Resource (org.camunda.bpm.engine.authorization.Resource)2 Authentication (org.camunda.bpm.engine.impl.identity.Authentication)2 AuthorizationEntity (org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity)2 HashMap (java.util.HashMap)1 FilterService (org.camunda.bpm.engine.FilterService)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 TaskService (org.camunda.bpm.engine.TaskService)1 Filter (org.camunda.bpm.engine.filter.Filter)1 Tenant (org.camunda.bpm.engine.identity.Tenant)1 AuthorizationCheckResultDto (org.camunda.bpm.engine.rest.dto.authorization.AuthorizationCheckResultDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 AuthorizationUtil (org.camunda.bpm.engine.rest.util.AuthorizationUtil)1 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)1