Resource processDefinitionABCAuth = new Resource() { @Override public int resourceType() { return 10; } @Override public String resourceName() { return PROCESS_DEFINITION_KEY; } }; Authorization auth1 = authorizationService().createNewAuthorization(Authorization.AUTH_TYPE_GRANT); auth1.setGroupId("management"); auth1.setPermissions(new Permissions[] { Permissions.ACCESS, Permissions.CREATE }); auth1.setResource(processDefinitionABCAuth); // auth1.setResourceId("*"); // What to type here? authorizationService().saveAuthorization(auth1);
identityService().setAuthenticatedUserId("john"); assertThat(authorizationService().isUserAuthorized("john", null, Permissions.ACCESS, processDefinitionABCAuth)).isFalse(); assertThat(authorizationService().isUserAuthorized("peter", Arrays.asList(new String[] {"management"}), Permissions.ACCESS, processDefinitionABCAuth)).isTrue();
authorizationService().isUserAuthorized(...)
Hi Ingo.
From the vision the resource id could be anything – especially process definition keys, ids, activity ids and so on. So in next steps when we might extend the permission features of the engine we already have the data structure and infrastructure in place. So in the current state “only” (haha) the checking of other ressources is not yet implemented.
Somebody from the core-dev might correct me if that vision from the beginning has changed.
Cheers
Bernd
--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/5b9bd26d-a6cc-481d-aca2-218004ed079b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.