Package org.springframework.security

Examples of org.springframework.security.AccessDeniedException


  }

  @Override
  public List<RepositoryFileAce> getEffectiveAces( final Serializable fileId ) {
    if ( !hasAccess( fileId, EnumSet.of( READ ) ) ) {
      throw new AccessDeniedException( "access denied" );
    }
    return internalGetEffectiveAces( fileId );
  }
View Full Code Here


  }

  @Override
  public Map<String, Serializable> getFileMetadata( final Serializable fileId ) {
    if ( !hasAccess( fileId, EnumSet.of( READ ) ) ) {
      throw new AccessDeniedException( "access denied" );
    }
    FileRecord r = idManager.getFileById( fileId );
    return r.getMetadata();
  }
View Full Code Here

  @Override
  public RepositoryFile updateFolder( RepositoryFile folder, String versionMessage ) {
    Validate.isTrue( folder.isFolder() );
    if ( !hasAccess( folder.getId(), EnumSet.of( WRITE ) ) ) {
      throw new AccessDeniedException( "access denied" );
    }
    FileRecord fileRecord = idManager.getFileById( folder.getId() );
    fileRecord.setFile( new RepositoryFile.Builder( folder ).hidden( folder.isHidden() ).title( findTitle( folder ) )
        .description( findDesc( folder ) ).build() );
    if ( folder.isVersioned() ) {
View Full Code Here

        Authentication user = user();
        if (user == null || user.getAuthorities().length == 0)
            return new InsufficientAuthenticationException("Cannot access "
                    + resourceName + " as anonymous");
        else
            return new AccessDeniedException("Cannot access "
                    + resourceName + " with the current privileges");
    }
View Full Code Here

        // is an unauthorized direct resource access, complain
        Authentication user = user();
        if (user == null || user.getAuthorities().length == 0)
            return new InsufficientAuthenticationException("Operation unallowed with the current privileges");
        else
            return new AccessDeniedException("Operation unallowed with the current privileges");
    }
View Full Code Here

                        break;
                    }
                }
               
                if(!roleFound) {
                    throw new AccessDeniedException("Cannot access "
                            + service + "." + method + " with the current privileges");
                }
            }
        }
       
View Full Code Here

            }
        }

        if (!found)
        {
            throw new AccessDeniedException("You can only delete feed subscriptions you own.");
        }
    }
View Full Code Here

            throws AccessDeniedException, InsufficientAuthenticationException {

        AccessDecisionVoter voter = (AccessDecisionVoter) this.getDecisionVoters().get(0);
        int decision = voter.vote(auth, arg1, arg2);
        if (decision != AccessDecisionVoter.ACCESS_GRANTED) {
            throw new AccessDeniedException("Access Denied: " + arg1.toString());
        }
    }
View Full Code Here

            throws AccessDeniedException, InsufficientAuthenticationException {

        AccessDecisionVoter voter = (AccessDecisionVoter) this.getDecisionVoters().get(0);
        int decision = voter.vote(auth, arg1, arg2);
        if (decision != AccessDecisionVoter.ACCESS_GRANTED) {
            throw new AccessDeniedException("Access Denied: " + arg1.toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.AccessDeniedException

Copyright © 2018 www.massapicom. 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.