Package gwtappcontainer.server.apps.security

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


   
    api.addRole("role1", helper.loginAsSuperUser());
    api.assignPrivilegeToRole("role1", "privilege1", helper.loginAsSuperUser());
   
    api.assignPrivilegeToUser("test@test.com", "privilege2", helper.loginAsSuperUser());
    api.assignRoleToUser("test@test.com", "role1", helper.loginAsSuperUser());
       
    UserProp userProp = (UserProp) api.getUser("test@test.com").object;
    assertTrue(userProp.email.equals("test@test.com"));   
    assertTrue(userProp.privileges.contains("PRIVILEGE2"));
    assertTrue(userProp.roles.first().role.equals("ROLE1"));
View Full Code Here


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

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

   
    response = api.assignRoleToUser("test@test.com", "role1",
        helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.assignRoleToUser("test@test.com", "role1",
        helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
    response = api.assignRoleToUser("test@test.com", "role1",
        helper.loginWithPrivilege(Privileges.EDIT_USER));
View Full Code Here

   
    response = api.assignRoleToUser("test@test.com", "role1",
        helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
    response = api.assignRoleToUser("test@test.com", "role1",
        helper.loginWithPrivilege(Privileges.EDIT_USER));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    UserProp userProp = (UserProp) api.getUser("test@test.com").object;
    assertTrue(userProp.email.equals("test@test.com"));
View Full Code Here

    api.addRole("role2", helper.loginAsSuperUser());
    api.addPrivilege("privilege1", helper.loginAsSuperUser());
   
    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);
   
View Full Code Here

    api.addPrivilege("privilege1", helper.loginAsSuperUser());
   
    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",
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.