protected internal virtual bool isAuthorized(Permission permission, Resource resource, string resourceId) { if (!processEngine.ProcessEngineConfiguration.AuthorizationEnabled) { // if authorization is disabled everyone is authorized return(true); } //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.camunda.bpm.engine.IdentityService identityService = processEngine.getIdentityService(); IdentityService identityService = processEngine.IdentityService; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.camunda.bpm.engine.AuthorizationService authorizationService = processEngine.getAuthorizationService(); AuthorizationService authorizationService = processEngine.AuthorizationService; Authentication authentication = identityService.CurrentAuthentication; if (authentication == null) { return(true); } else { return(authorizationService.isUserAuthorized(authentication.UserId, authentication.GroupIds, permission, resource, resourceId)); } }
// authorization /////////////////////////////////////////////////////// protected internal virtual void createGrantAuthorization(Resource resource, string resourceId, Permission permission, string userId) { Authorization authorization = createGrantAuthorization(resource, resourceId); authorization.UserId = userId; authorization.addPermission(permission); saveAuthorization(authorization); }
protected internal static Authorization createAuthorization(AuthorizationService authorizationService, Permission permission, Resources resource, string userId) { Authorization auth = authorizationService.createNewAuthorization(AUTH_TYPE_GRANT); auth.addPermission(permission); auth.Resource = resource; auth.ResourceId = org.camunda.bpm.engine.authorization.Authorization_Fields.ANY; auth.UserId = userId; return(auth); }
protected internal virtual void checkAuthorizations(CommandContext commandContext, Permission permission) { foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers) { checker.checkCreateBatch(permission); } }
protected internal virtual bool isAuthorized(Permission permission) { return(isAuthorized(permission, resource)); }
public virtual void checkCreateBatch(Permission permission) { }