Package gwtappcontainer.server.apps.security

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


    api.assignPrivilegeToRole("role1", "privilege1", helper.loginAsSuperUser());
   
    api.assignRoleToUser("test@test.com", "role1", helper.loginAsSuperUser());
    api.assignRoleToUser("test@test.com", "role2", helper.loginAsSuperUser());
   
    APIResponse response = api.unassignRoleToUser("test@test.com", "role2", null);   
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.unassignRoleToUser("test@test.com", "role2",
        helper.loginAsInvalidUser());   
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
View Full Code Here


    api.assignRoleToUser("test@test.com", "role2", helper.loginAsSuperUser());
   
    APIResponse response = api.unassignRoleToUser("test@test.com", "role2", null);   
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.unassignRoleToUser("test@test.com", "role2",
        helper.loginAsInvalidUser());   
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.unassignRoleToUser("test@test.com", "role2",
        helper.loginWithPrivilege(Privileges.EDIT_USER));   
View Full Code Here

   
    response = api.unassignRoleToUser("test@test.com", "role2",
        helper.loginAsInvalidUser());   
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.unassignRoleToUser("test@test.com", "role2",
        helper.loginWithPrivilege(Privileges.EDIT_USER));   
    assertTrue(response.statusCode == Status.SUCCESS);
   
    UserProp userProp = (UserProp) api.getUser("test@test.com").object;
    assertTrue(userProp.roles.size() == 1);
View Full Code Here

    UserProp userProp = (UserProp) api.getUser("test@test.com").object;
    assertTrue(userProp.roles.size() == 1);
    assertTrue(userProp.roles.first().role.equals("ROLE1"));
           
    //admin can also unassign
    response = api.unassignRoleToUser("test@test.com", "role1",
        helper.loginAsSuperUser());   
    assertTrue(response.statusCode == Status.SUCCESS);
   
    userProp = (UserProp) api.getUser("test@test.com").object;
    assertTrue(userProp.roles.size() == 0);       
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.