Package org.camunda.bpm.engine.impl.persistence.entity

Examples of org.camunda.bpm.engine.impl.persistence.entity.AuthorizationManager


  protected void saveDefaultAuthorizations(final AuthorizationEntity[] authorizations) {
    if(authorizations != null) {
      Context.getCommandContext().runWithoutAuthentication(new Runnable() {
        public void run() {
          AuthorizationManager authorizationManager = Context.getCommandContext()
              .getAuthorizationManager();
          for (AuthorizationEntity authorization : authorizations) {
            authorizationManager.insert(authorization);
          }
        }
      });
    }
  }
View Full Code Here


    ensureNotNull("Authorization 'resourceType' cannot be null.", "authorization.getResource()", authorization.getResource());
  }
 
  public Authorization execute(CommandContext commandContext) {
   
    final AuthorizationManager authorizationManager = commandContext.getAuthorizationManager();
   
    if(authorization.getId() == null) {
      authorizationManager.insert(authorization);
     
    } else {
      authorizationManager.update(authorization);
     
    }
   
    return authorization;
  }
View Full Code Here

    this.authorizationId = authorizationId;
  }
 
  public Void execute(CommandContext commandContext) {

    final AuthorizationManager authorizationManager = commandContext.getAuthorizationManager();

    AuthorizationEntity authorization = (AuthorizationEntity) new AuthorizationQueryImpl(commandContext)
      .authorizationId(authorizationId)
      .singleResult();

    ensureNotNull("Authorization for Id '" + authorizationId + "' does not exist", "authorization", authorization);

    authorizationManager.delete(authorization);

    return null;
  }
View Full Code Here

    this.resource = resource;
    this.resourceId = resourceId;
  }

  public Boolean execute(CommandContext commandContext) {
    final AuthorizationManager authorizationManager = commandContext.getAuthorizationManager();   
    return authorizationManager.isAuthorized(userId, groupIds, permission, resource, resourceId);
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.impl.persistence.entity.AuthorizationManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.