Package gwtappcontainer.server.apps.security

Examples of gwtappcontainer.server.apps.security.SecurityAPI.deletePrivilege()


   
    APIResponse response = api.addPrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
   
    //should have the right privilege
    response = api.deletePrivilege("test", null);
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.deletePrivilege("test", helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
View Full Code Here


   
    //should have the right privilege
    response = api.deletePrivilege("test", null);
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.deletePrivilege("test", helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.deletePrivilege("test", helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
View Full Code Here

    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.deletePrivilege("test", helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.deletePrivilege("test", helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
    response = api.deletePrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
    assertTrue(response.statusCode == Status.SUCCESS);
View Full Code Here

    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.deletePrivilege("test", helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
    response = api.deletePrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = api.getAllPrivileges();
    TreeSet<String> all = (TreeSet<String>) response.object;
View Full Code Here

    response = api.getAllPrivileges();
    TreeSet<String> all = (TreeSet<String>) response.object;
    assertTrue(! all.contains("TEST"));
   
    //deleting the same privilege again should give correct error
    response = api.deletePrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE))
    assertTrue(response.statusCode == Status.ERROR_RESOURCE_DOES_NOT_EXIST);
       
    //admin can delete as well
    response = api.addPrivilege("test",
View Full Code Here

    //admin can delete as well
    response = api.addPrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = api.deletePrivilege("test", helper.loginAsSuperUser());
    assertTrue(response.statusCode == Status.SUCCESS);
    all = (TreeSet<String>) api.getAllPrivileges().object;
    assertTrue(! all.contains("TEST"))
  }
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.