Examples of AuthorizationManager


Examples of org.jboss.security.AuthorizationManager

    @return The Set<Principal> for the application domain roles that the
    principal has been assigned.
   */
   public Set<Principal> getUserRoles(Principal principal)
   {
      AuthorizationManager am = SecurityUtil.getAuthorizationManager(securityDomain,
            SecurityConstants.JAAS_CONTEXT_ROOT);
      return am.getUserRoles(principal);
   }
View Full Code Here

Examples of org.sonatype.security.authorization.AuthorizationManager

    PrivilegeStatusResourceResponse result = new PrivilegeStatusResourceResponse();

    Privilege priv = null;

    try {
      AuthorizationManager authzManager = getSecuritySystem().getAuthorizationManager(PRIVILEGE_SOURCE);
      priv = authzManager.getPrivilege(getPrivilegeId(request));
    }
    catch (NoSuchPrivilegeException e) {
      throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, "Privilege could not be found.");
    }
    catch (NoSuchAuthorizationManagerException e) {
View Full Code Here

Examples of org.uberfire.security.authz.AuthorizationManager

        final String forceURL = getForceURL( options );
        final AuthenticationScheme authScheme = getAuthenticationScheme( options );
        final AuthenticationManager authManager = getAuthenticationManager( options );
        final AuthenticationProvider authProvider = getAuthenticationProvider( options );
        final ResourceManager resourceManager = getResourceManager( options );
        final AuthorizationManager authzManager = getAuthorizationManager( options );
        final VotingStrategy urlVotingStrategy = getURLVotingStrategy( options );
        final ResourceDecisionManager accessDecisionManager = getURLAccessDecisionManager( options );
        final RoleDecisionManager roleDecisionManager = getRoleDecisionManager( options );
        final RoleProvider roleProvider = getRoleProvider( options );
        final SubjectPropertiesProvider propertiesProvider = getPropertiesProvider( options );
View Full Code Here

Examples of org.wso2.carbon.user.api.AuthorizationManager

     * @throws MessageBoxException if fails to check authorizations
     */
    public boolean isAuthorized(String messageBoxId, String operation) throws MessageBoxException {
        String loggedInUser = UserCoreUtil.getTenantLessUsername(CarbonContext.getCurrentContext().getUsername());
        try {
            AuthorizationManager authorizationManager = Utils.getUserRelam().getAuthorizationManager();

            String messageBoxPath = MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH + "/" +
                                    messageBoxId;

            return authorizationManager.isUserAuthorized(loggedInUser, messageBoxPath, operation);
        } catch (UserStoreException e) {
            String error = "Failed to check is " + loggedInUser + " authorized to " + operation +
                           " to " + messageBoxId;
            log.error(error);
            throw new MessageBoxException(error, e);
View Full Code Here

Examples of org.wso2.carbon.user.api.AuthorizationManager

    }

    public boolean isUserAuthorized(String userName, String messageBoxId, String operation)
            throws MessageBoxException {
        try {
            AuthorizationManager authorizationManager = Utils.getUserRelam().getAuthorizationManager();

            String messageBoxPath = MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH + "/" +
                                    messageBoxId;

            return authorizationManager.isUserAuthorized(userName, messageBoxPath, operation);
        } catch (UserStoreException e) {
            String error = "Failed to check is " + userName + " authorized to " + operation +
                           " to " + messageBoxId;
            log.error(error);
            throw new MessageBoxException(error, e);
View Full Code Here

Examples of org.wso2.carbon.user.api.AuthorizationManager

     * @throws MessageBoxException if failed to apply permissions
     */
    public void addPermission(String messageBoxId, PermissionLabel permissionLabel)
            throws MessageBoxException {
        try {
            AuthorizationManager authorizationManager = Utils.getUserRelam().getAuthorizationManager();

            String messageBoxPath = MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH + "/" +
                                    messageBoxId;

            for (String sharedUser : permissionLabel.getSharedUsers()) {
                for (String operation : permissionLabel.getOperations()) {
                    authorizationManager.authorizeUser(sharedUser, messageBoxPath, operation);
                }
            }
        } catch (UserStoreException e) {
            String error = "Failed to add permissions to " + messageBoxId + " with permission label "
                           + permissionLabel.getLabelName();
View Full Code Here

Examples of org.wso2.carbon.user.core.AuthorizationManager

            // Check whether the system dashboard is already available if not populate
            UserRegistry registry = DashboardPopulatorContext.getRegistry(tenantId);

            // Set permission for annonymous read. We do it here because it should happen always in order
            // to support mounting a remote registry.
            AuthorizationManager accessControlAdmin =
                    registry.getUserRealm().getAuthorizationManager();

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

            String serverName = CarbonUtils.getServerConfiguration().getFirstProperty("Name");
View Full Code Here

Examples of org.wso2.carbon.user.core.AuthorizationManager

            UserRegistry uReg = (UserRegistry) registry;

            // Creating the default gadget collection resource
            Collection defaultGadgetCollection = registry.newCollection();
            // Set permission for annonymous read
            AuthorizationManager authorizationManager = uReg.getUserRealm().getAuthorizationManager();
            authorizationManager.authorizeRole(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                    SYSTEM_GS_GADGETS_PATH, ActionConstants.GET);

            /*authorizationManager.authorizeRole(RegistryConstants.GUESTS_ROLE,
                                             SYSTEM_GS_GADGETS_PATH, ActionConstants.GET);*/

 
View Full Code Here

Examples of org.wso2.carbon.user.core.AuthorizationManager

            // Set permission for anonymous read. We do it here because it should happen always in order
            // to support mounting a remote registry.

            if (registry != null) {
                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

Examples of org.wso2.carbon.user.core.AuthorizationManager

                    }

                    // Set permission for anonymous read. We do it here because it should happen always in order
                    // to support mounting a remote registry.
                    UserRegistry userRegistry = getRegistry(tenantId);
                    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
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.