// add base permission which allows nobody to create authorizations
Authorization basePerms = authorizationService.createNewAuthorization(AUTH_TYPE_GLOBAL);
basePerms.setResource(AUTHORIZATION);
basePerms.setResourceId(ANY);
basePerms.addPermission(ALL); // add all then remove 'crate'
basePerms.removePermission(CREATE);
authorizationService.saveAuthorization(basePerms);
// now enable authorizations:
processEngineConfiguration.setAuthorizationEnabled(true);
identityService.setAuthenticatedUserId(jonny2);