Package org.wso2.carbon.user.core

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


                    AuthorizationManager accessControlAdmin =
                            userRegistry.getUserRealm().getAuthorizationManager();

                    if (!accessControlAdmin.isRoleAuthorized(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                            REGISTRY_GADGET_STORAGE_PATH, ActionConstants.GET)) {
                        accessControlAdmin.authorizeRole(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                                REGISTRY_GADGET_STORAGE_PATH, ActionConstants.GET);
                    }

                    // recurse
                    transferDirectoryContentToRegistry(file, registry, rootPath, tenantId);
View Full Code Here


            if (userGroups != null) {
                AuthorizationManager acAdmin = realm.getAuthorizationManager();

                for (int i = 0; i < userGroups.length; i++) {
                    String value = userGroups[i];
                    acAdmin.authorizeRole(value, servicePath,
                            UserCoreConstants.INVOKE_SERVICE_PERMISSION);
                }
            }

            if (isRahasEngaged) {
View Full Code Here

                AuthorizationManager accessControlAdmin =
                        registry.getUserRealm().getAuthorizationManager();

                if (!accessControlAdmin.isRoleAuthorized(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                        REGISTRY_GADGET_STORAGE_PATH, ActionConstants.GET)) {
                    accessControlAdmin.authorizeRole(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                            REGISTRY_GADGET_STORAGE_PATH, ActionConstants.GET);
                }

                File gadgetsDir = new File(extractedArchiveDir);
                if (gadgetsDir.exists()) {
View Full Code Here

                    AuthorizationManager accessControlAdmin =
                            userRegistry.getUserRealm().getAuthorizationManager();

                    if (!accessControlAdmin.isRoleAuthorized(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                            REGISTRY_GADGET_STORAGE_PATH, ActionConstants.GET)) {
                        accessControlAdmin.authorizeRole(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                                REGISTRY_GADGET_STORAGE_PATH, ActionConstants.GET);
                    }

                    // recurse
                    transferDirectoryContentToRegistry(file, registry, rootPath, tenantId);
View Full Code Here

                        AuthorizationManager authManager = CurrentSession.getUserRealm().getAuthorizationManager();
                        authManager.clearResourceAuthorizations(newresourcePath);
                        String[] roles = newRoles.split(",");
                        for (String role: roles) {
                            String roleName = role.trim();
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.GET);
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.PUT);
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.DELETE);
View Full Code Here

                        String[] roles = newRoles.split(",");
                        for (String role: roles) {
                            String roleName = role.trim();
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.GET);
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.PUT);
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.DELETE);
                        }
                    } catch (UserStoreException e) {
View Full Code Here

                            String roleName = role.trim();
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.GET);
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.PUT);
                            authManager.authorizeRole(roleName, newresourcePath,
                                    ActionConstants.DELETE);
                        }
                    } catch (UserStoreException e) {
                        throw new RegistryException("Unable to setup roles for resource.", e);
                    }
View Full Code Here

                String adminUserName = CarbonConstants.REGISTRY_SYSTEM_USERNAME;

                ac.authorizeUser(adminUserName, "/system", ActionConstants.GET);

                String adminRoleName = realmConfig.getAdminRoleName();
                ac.authorizeRole(adminRoleName, "/system", ActionConstants.GET);

                // any user should be able to execute auto generated queries, though the results
                // of such queries are filtered to match current users permission level.
                String everyoneRoleName = realmConfig.getEveryOneRoleName();
                ac.authorizeRole(everyoneRoleName,
View Full Code Here

                ac.authorizeRole(adminRoleName, "/system", ActionConstants.GET);

                // any user should be able to execute auto generated queries, though the results
                // of such queries are filtered to match current users permission level.
                String everyoneRoleName = realmConfig.getEveryOneRoleName();
                ac.authorizeRole(everyoneRoleName,
                        "/system/queries/advanced", ActionConstants.GET);

            } catch (UserStoreException e) {
                String msg = "Failed to set permissions for the system collection.";
                log.fatal(msg, e);
View Full Code Here

            }

            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);
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.