Examples of ensureRole()


Examples of gwtappcontainer.server.apis.admin.GateKeeper.ensureRole()

  @Test
  public void ensureRoleReturnsTrueForExistingRole() {
       
    GateKeeper gateKeeper = new GateKeeper();
    User user = helper.loginAsDeveloper();
    assertTrue(gateKeeper.ensureRole(user, Role.DEVELOPER, Role.PORTAL_ADMIN));
   
    assertTrue(gateKeeper.ensureRole(user, Role.DEVELOPER.toString(),
        Role.PORTAL_READONLY.toString()));   
  }
 
View Full Code Here

Examples of gwtappcontainer.server.apis.admin.GateKeeper.ensureRole()

       
    GateKeeper gateKeeper = new GateKeeper();
    User user = helper.loginAsDeveloper();
    assertTrue(gateKeeper.ensureRole(user, Role.DEVELOPER, Role.PORTAL_ADMIN));
   
    assertTrue(gateKeeper.ensureRole(user, Role.DEVELOPER.toString(),
        Role.PORTAL_READONLY.toString()));   
  }
 
  @Test
  public void ensureRoleThrowsExceptionForNonExistingRole() {
View Full Code Here

Examples of gwtappcontainer.server.apis.admin.GateKeeper.ensureRole()

   
    GateKeeper gateKeeper = new GateKeeper();
    User user = helper.loginAsDeveloper();
   
    try {
      gateKeeper.ensureRole(user, Role.PORTAL_ADMIN);
    } catch (APIException e) {
      assertTrue(e.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
      return;
    }
     
View Full Code Here

Examples of gwtappcontainer.server.apis.admin.GateKeeper.ensureRole()

  @Test
  public void ensureRoleThrowsExceptionIfNotLoggedIn() {
    GateKeeper gateKeeper = new GateKeeper();
       
    try {
      gateKeeper.ensureRole(null, Role.PORTAL_READONLY.toString());
    } catch (APIException e) {
      assertTrue(e.statusCode == Status.ERROR_LOGIN_REQUIRED);
      return;
    }
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.