Examples of AuthorizationException


Examples of org.apache.maven.wagon.authorization.AuthorizationException

                throw e;
            }

            case HttpStatus.SC_FORBIDDEN:
                fireSessionConnectionRefused();
                throw new AuthorizationException( "Access denied to: " + url );

            case HttpStatus.SC_UNAUTHORIZED:
                fireSessionConnectionRefused();
                throw new AuthorizationException( "Not authorized." );

            case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:
                fireSessionConnectionRefused();
                throw new AuthorizationException( "Not authorized by proxy." );

            case HttpStatus.SC_NOT_FOUND:
                throw new ResourceDoesNotExistException( "File: " + url + " does not exist" );

                // add more entries here
View Full Code Here

Examples of org.apache.shiro.authz.AuthorizationException

    @Override
    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {

        //null usernames are invalid
        if (principals == null) {
            throw new AuthorizationException("PrincipalCollection method argument cannot be null.");
        }

        String username = (String) getAvailablePrincipal(principals);

        Connection conn = null;
        Set<String> roleNames = null;
        Set<String> permissions = null;
        try {
            conn = dataSource.getConnection();

            // Retrieve roles and permissions from database
            roleNames = getRoleNamesForUser(conn, username);
            if (permissionsLookupEnabled) {
                permissions = getPermissions(conn, username, roleNames);
            }

        } catch (SQLException e) {
            final String message = "There was a SQL error while authorizing user [" + username + "]";
            if (log.isErrorEnabled()) {
                log.error(message, e);
            }

            // Rethrow any SQL errors as an authorization exception
            throw new AuthorizationException(message, e);
        } finally {
            JdbcUtils.closeConnection(conn);
        }

        SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(roleNames);
View Full Code Here

Examples of org.archfirst.bfoms.domain.security.AuthorizationException

            User user,
            Long accountId,
            BrokerageAccountPermission requiredPermission) {
       
        if (accountId == null)
            throw new AuthorizationException();
        BrokerageAccount account = brokerageAccountRepository.findAccount(accountId);
        checkAccountAuthorizationHelper(user, account, requiredPermission);
        return account;
    }
View Full Code Here

Examples of org.beangle.security.AuthorizationException

    if (null == realms) {
      realms = restrictionService.getRestrictions(user, resource);
      restrictionMap.put(resource.getId(), realms);
    }
    // 没有权限就报错
    if (realms.isEmpty()) { throw new AuthorizationException(SecurityContextHolder.getContext()
        .getAuthentication(), resource.getName()); }
    return realms;
  }
View Full Code Here

Examples of org.camunda.bpm.engine.AuthorizationException

    if(processEngineConfiguration.isAuthorizationEnabled() && currentAuthentication != null) {

      boolean isAuthorized = isAuthorized(currentAuthentication.getUserId(), currentAuthentication.getGroupIds(), permission, resource, resourceId);
      if (!isAuthorized) {
        throw new AuthorizationException(currentAuthentication.getUserId(), permission.getName(), resource.resourceName(), resourceId);
      }
    }

  }
View Full Code Here

Examples of org.eurekastreams.commons.exceptions.AuthorizationException

                will(returnValue(transStatus));

                oneOf(validationStrategy).validate(serviceActionContext);

                oneOf(authorizationStrategy).authorize(serviceActionContext);
                will(throwException(new AuthorizationException()));

                oneOf(transStatus).isCompleted();
                will(returnValue(false));

                oneOf(transMgrMock).rollback(transStatus);
View Full Code Here

Examples of org.jasig.portal.AuthorizationException

    /* (non-Javadoc)
     * @see org.jasig.portal.channels.error.tt.AbstractThrowableToElementTest#supportedThrowable()
     */
    protected Throwable supportedThrowable() {
        return new AuthorizationException("A message");
    }
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

    }

    public void init() {
        if (isManaged()) {
            if (!Identity.instance().hasPermission("User", "edit", getInstance()) ) {
                throw new AuthorizationException("You don't have permission for this operation");
            }
            if (roles == null) roles = getInstance().getRoles();
            if (oldUsername == null) oldUsername = getInstance().getUsername();

            createdWikiNodeCount = userDAO.countNodesCreatedBy(getInstance().getId());

            uploader = (Uploader)Component.getInstance(Uploader.class);

        } else {
            if (!prefs.getEnableRegistration() &&
                !Identity.instance().hasPermission("User", "isAdmin", Component.getInstance("currentUser"))) {
                throw new AuthorizationException("User registration is disabled");
            }

            if (defaultRole == null) defaultRole = (Role)Component.getInstance("newUserDefaultRole");
        }
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

                if (currentFile == null) {
                    throw new org.jboss.seam.framework.EntityNotFoundException(getFileId(), WikiDocument.class);
                }

                if (!Identity.instance().hasPermission("Node", "read", currentFile) ) {
                    throw new AuthorizationException("You don't have permission for this operation");
                }
            }

            initializeHistoricalFileList();
        }
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

        initEditor(false);
        if (isManaged()) {

            // Additional permission required besides NodeHome.remove()
            if (!Identity.instance().hasPermission("Comment", "delete", getInstance().getParent()) ) {
                throw new AuthorizationException("You don't have permission for this operation");
            }

            // Remove feed entry before removing comment
            feedDAO.removeFeedEntry(
                feedDAO.findFeeds(getInstance()),
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.