use of org.camunda.bpm.engine.identity.Group in project camunda-bpm-platform by camunda.
the class TaskQueryExpressionTest method setUp.
@Before
public void setUp() {
group1 = createGroup("group1");
Group group2 = createGroup("group2");
Group group3 = createGroup("group3");
user = createUser("user", group1.getId(), group2.getId());
anotherUser = createUser("anotherUser", group3.getId());
userWithoutGroups = createUser("userWithoutGroups");
setTime(1427547759000l);
task = createTestTask("task");
// shift time to force distinguishable create times
adjustTime(2 * 60);
Task anotherTask = createTestTask("anotherTask");
Task assignedCandidateTask = createTestTask("assignedCandidateTask");
taskService.setOwner(task.getId(), user.getId());
taskService.setAssignee(task.getId(), user.getId());
taskService.addCandidateUser(anotherTask.getId(), user.getId());
taskService.addCandidateGroup(anotherTask.getId(), group1.getId());
taskService.setAssignee(assignedCandidateTask.getId(), user.getId());
taskService.addCandidateUser(assignedCandidateTask.getId(), user.getId());
taskService.addCandidateGroup(assignedCandidateTask.getId(), group1.getId());
}
use of org.camunda.bpm.engine.identity.Group in project camunda-bpm-platform by camunda.
the class TaskCandidateTest method setUp.
public void setUp() throws Exception {
super.setUp();
Group accountants = identityService.newGroup("accountancy");
identityService.saveGroup(accountants);
Group managers = identityService.newGroup("management");
identityService.saveGroup(managers);
Group sales = identityService.newGroup("sales");
identityService.saveGroup(sales);
User kermit = identityService.newUser(KERMIT);
identityService.saveUser(kermit);
identityService.createMembership(KERMIT, "accountancy");
User gonzo = identityService.newUser(GONZO);
identityService.saveUser(gonzo);
identityService.createMembership(GONZO, "management");
identityService.createMembership(GONZO, "accountancy");
identityService.createMembership(GONZO, "sales");
}
use of org.camunda.bpm.engine.identity.Group in project camunda-bpm-platform by camunda.
the class PurgeDatabaseTest method createAuthenticationData.
private void createAuthenticationData() {
IdentityService identityService = engineRule.getIdentityService();
Group group = identityService.newGroup("group");
identityService.saveGroup(group);
User user = identityService.newUser("user");
User user2 = identityService.newUser("user2");
identityService.saveUser(user);
identityService.saveUser(user2);
Tenant tenant = identityService.newTenant("tenant");
identityService.saveTenant(tenant);
Tenant tenant2 = identityService.newTenant("tenant2");
identityService.saveTenant(tenant2);
identityService.createMembership("user", "group");
identityService.createTenantUserMembership("tenant", "user");
identityService.createTenantUserMembership("tenant2", "user2");
TestResource resource1 = new TestResource("resource1", 100);
// create global authorization which grants all permissions to all users (on resource1):
AuthorizationService authorizationService = engineRule.getAuthorizationService();
Authorization globalAuth = authorizationService.createNewAuthorization(AUTH_TYPE_GLOBAL);
globalAuth.setResource(resource1);
globalAuth.setResourceId(ANY);
globalAuth.addPermission(ALL);
authorizationService.saveAuthorization(globalAuth);
// grant user read auth on resource2
TestResource resource2 = new TestResource("resource2", 200);
Authorization userGrant = authorizationService.createNewAuthorization(AUTH_TYPE_GRANT);
userGrant.setUserId("user");
userGrant.setResource(resource2);
userGrant.setResourceId(ANY);
userGrant.addPermission(READ);
authorizationService.saveAuthorization(userGrant);
identityService.setAuthenticatedUserId("user");
}
use of org.camunda.bpm.engine.identity.Group in project camunda-bpm-platform by camunda.
the class DefaultPermissionForTenantMemberTest method init.
@Before
public void init() {
identityService = engineRule.getIdentityService();
authorizationService = engineRule.getAuthorizationService();
createTenant(TENANT_ONE);
User user = identityService.newUser(USER_ID);
identityService.saveUser(user);
Group group = identityService.newGroup(GROUP_ID);
identityService.saveGroup(group);
engineRule.getProcessEngineConfiguration().setAuthorizationEnabled(true);
}
use of org.camunda.bpm.engine.identity.Group in project camunda-bpm-platform by camunda.
the class HalGroupResolver method resolveNotCachedLinks.
protected List<HalResource<?>> resolveNotCachedLinks(String[] linkedIds, ProcessEngine processEngine) {
IdentityService identityService = processEngine.getIdentityService();
List<Group> groups = identityService.createGroupQuery().groupIdIn(linkedIds).listPage(0, linkedIds.length);
List<HalResource<?>> resolvedGroups = new ArrayList<HalResource<?>>();
for (Group group : groups) {
resolvedGroups.add(HalGroup.fromGroup(group));
}
return resolvedGroups;
}
Aggregations