Examples of updateRoleListOfUser()


Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

//            throw new RegistryException("Error in authorizing user3t0.");
//        }

        // then assign roles to the second set of users.
        try {
            userStoreManager1.updateRoleListOfUser("user4t0", null, new String[]{"role1t0"});
        } catch (UserStoreException e) {
            throw new RegistryException("Error in adding user user4t0 to role1t0 role.");
        }
        try {
            userStoreManager1.updateRoleListOfUser("user5t0", null, new String[]{"role2t0"});
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

            userStoreManager1.updateRoleListOfUser("user4t0", null, new String[]{"role1t0"});
        } catch (UserStoreException e) {
            throw new RegistryException("Error in adding user user4t0 to role1t0 role.");
        }
        try {
            userStoreManager1.updateRoleListOfUser("user5t0", null, new String[]{"role2t0"});
        } catch (UserStoreException e) {
            throw new RegistryException("Error in adding user user5t0 to role2t0 role.");
        }
        try {
            userStoreManager1.updateRoleListOfUser("user6t0", null, new String[]{"role3t0"});
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

            userStoreManager1.updateRoleListOfUser("user5t0", null, new String[]{"role2t0"});
        } catch (UserStoreException e) {
            throw new RegistryException("Error in adding user user5t0 to role2t0 role.");
        }
        try {
            userStoreManager1.updateRoleListOfUser("user6t0", null, new String[]{"role3t0"});
        } catch (UserStoreException e) {
            throw new RegistryException("Error in adding user user6t0 to role3t0 role.");
        }

        // now giving authorizations to the role.
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

                    }
                    delRoles.add(name);
                }
            }

            admin.updateRoleListOfUser(userName, delRoles.toArray(new String[delRoles.size()]),
                    addRoles.toArray(new String[addRoles.size()]));
        } catch (UserStoreException e) {
            // previously logged so logging not needed
            throw new UserAdminException(e.getMessage(), e);
        } catch (Exception e) {
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

        admin.addRole("role2", null, null);
        admin.addRole("role3", null, null);
        admin.addRole("role4", null, null);

        admin.updateRoleListOfUser("saman", null, new String[] { "role2" });
        admin.updateRoleListOfUser("saman", new String[] { "role2" }, new String[] { "role4",
                "role3" });

        String[] rolesOfSaman = admin.getRoleListOfUser("saman");
        assertEquals(3, rolesOfSaman.length);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

        admin.addRole("role2", null, null);
        admin.addRole("role3", null, null);
        admin.addRole("role4", null, null);

        admin.updateRoleListOfUser("saman", null, new String[] { "role2" });
        admin.updateRoleListOfUser("saman", new String[] { "role2" }, new String[] { "role4",
                "role3" });

        String[] rolesOfSaman = admin.getRoleListOfUser("saman");
        assertEquals(3, rolesOfSaman.length);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

        admin.updateUserListOfRole("role3", null, new String[] { "amara", "sunil" });

        // negative
        try {
            //wrong roles
            admin.updateRoleListOfUser("saman", new String[] { "x" }, new String[] { "y" });
            TestCase.assertTrue(false);
        } catch (Exception e) {
            // exptected error in negative testing

        }
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

        admin.addRole("role4", null, null);
        admin.addUser("saman", "pass1", null, null, null, false);
        admin.addUser("amara", "pass2", null, null, null, false);
        admin.addUser("sunil", "pass3", null, null, null, false);

        admin.updateRoleListOfUser("saman", null, new String[] { "role2" });
        admin.updateRoleListOfUser("saman", new String[] { "role2" }, new String[] { "role4",
                "role3" });

        String[] rolesOfSaman = admin.getRoleListOfUser("saman");
        assertEquals(3, rolesOfSaman.length);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

        admin.addUser("saman", "pass1", null, null, null, false);
        admin.addUser("amara", "pass2", null, null, null, false);
        admin.addUser("sunil", "pass3", null, null, null, false);

        admin.updateRoleListOfUser("saman", null, new String[] { "role2" });
        admin.updateRoleListOfUser("saman", new String[] { "role2" }, new String[] { "role4",
                "role3" });

        String[] rolesOfSaman = admin.getRoleListOfUser("saman");
        assertEquals(3, rolesOfSaman.length);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserStoreManager.updateRoleListOfUser()

        String[] users = admin.getUserListOfRole("role3");
        assertEquals(3, users.length);

        // negative
        try {
            admin.updateRoleListOfUser("saman", new String[] { "x" }, new String[] { "y" });
            TestCase.assertTrue(false);
        } catch (Exception e) {
            // exptected error in negative testing

        }
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.