Package org.wso2.carbon.user.core

Examples of org.wso2.carbon.user.core.AuthorizationManager.authorizeRole()


            String adminRoleName = realmConfig.getAdminRoleName();
            String everyoneRoleName = realmConfig.getEveryOneRoleName();

            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.GET);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.PUT);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.DELETE);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    AccessControlConstants.AUTHORIZE);
View Full Code Here


            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.GET);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.PUT);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.DELETE);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    AccessControlConstants.AUTHORIZE);

            accessControlAdmin.authorizeRole(everyoneRoleName, rootPath,
View Full Code Here

                    ActionConstants.GET);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.PUT);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.DELETE);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    AccessControlConstants.AUTHORIZE);

            accessControlAdmin.authorizeRole(everyoneRoleName, rootPath,
                    ActionConstants.GET);
View Full Code Here

            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    ActionConstants.DELETE);
            accessControlAdmin.authorizeRole(adminRoleName, rootPath,
                    AccessControlConstants.AUTHORIZE);

            accessControlAdmin.authorizeRole(everyoneRoleName, rootPath,
                    ActionConstants.GET);

        } catch (UserStoreException e) {
            String msg = "Could not set authorizations for the root. \nCaused by: "
                    + e.getMessage();
View Full Code Here

            throw new RegistryException("Error in adding user user6t0 to role3t0 role.");
        }

        // now giving authorizations to the role.
        try {
            authorizationManager1.authorizeRole("role1t0", "/test2", ActionConstants.PUT);
        } catch (UserStoreException e) {
            throw new RegistryException("Error in authorizing role1t0.");
        }
        try {
            authorizationManager1.authorizeRole("role2t0", "/test2", ActionConstants.DELETE);
View Full Code Here

            authorizationManager1.authorizeRole("role1t0", "/test2", ActionConstants.PUT);
        } catch (UserStoreException e) {
            throw new RegistryException("Error in authorizing role1t0.");
        }
        try {
            authorizationManager1.authorizeRole("role2t0", "/test2", ActionConstants.DELETE);
        } catch (UserStoreException e) {
            throw new RegistryException("Error in authorizing role2t0.");
        }
        try {
            authorizationManager1.authorizeRole("role3t0", "/test2", "authorize");
View Full Code Here

            authorizationManager1.authorizeRole("role2t0", "/test2", ActionConstants.DELETE);
        } catch (UserStoreException e) {
            throw new RegistryException("Error in authorizing role2t0.");
        }
        try {
            authorizationManager1.authorizeRole("role3t0", "/test2", "authorize");
        } catch (UserStoreException e) {
            throw new RegistryException("Error in authorizing role3t0.");
        }

        // secondly we will check the user store from tenant 1 and verify no overlaps with tenant 0
View Full Code Here

            }
            String[] optimizedList = UserCoreUtil.optimizePermissions(rawResources);
            AuthorizationManager authMan = realm.getAuthorizationManager();
            authMan.clearRoleActionOnAllResources(roleName, UserMgtConstants.EXECUTE_ACTION);
            for (String path : optimizedList) {
                authMan.authorizeRole(roleName, path, UserMgtConstants.EXECUTE_ACTION);
            }
        } catch (UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new UserAdminException(e.getMessage(), e);
        }
View Full Code Here

            String[] optimizedList = UserCoreUtil.optimizePermissions(rawPermissions);
            UserRealm realm = AdminServicesUtil.getUserRealm();
            AuthorizationManager authMan = realm.getAuthorizationManager();
            authMan.clearRoleActionOnAllResources(roleName, UserMgtConstants.EXECUTE_ACTION);
            for (String path : optimizedList) {
                authMan.authorizeRole(roleName, path, UserMgtConstants.EXECUTE_ACTION);
            }
        } catch (UserStoreException e) {
            // not logging already logged
            throw new UserAdminException(e.getMessage(), e);
        } catch (CarbonException e) {
View Full Code Here

            UserRealm realm = registry.getUserRealm();
            String adminRole = realm.getRealmConfiguration().getAdminRoleName();
            AuthorizationManager authMan = realm.getAuthorizationManager();
            if (!authMan.isRoleAuthorized(adminRole, CarbonConstants.UI_PERMISSION_COLLECTION,
                    UserMgtConstants.EXECUTE_ACTION)) {
                authMan.authorizeRole(adminRole, CarbonConstants.UI_PERMISSION_COLLECTION,
                        UserMgtConstants.EXECUTE_ACTION);
            }
        } catch (Exception e) {
            log.error("While adding management permission :: " + e.getMessage(), e);
            throw new Exception("While adding management permission :: " + e.getMessage(), e);
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.