Examples of Secured


Examples of org.springframework.security.access.annotation.Secured

     * @see #hasAccessToSecuredObject(Object)
     */
    public boolean hasAccessToSecuredMethod(Object securedObject, String methodName, Class<?>... methodParameterTypes) {
        try {
            final Method method = securedObject.getClass().getMethod(methodName, methodParameterTypes);
            final Secured secured = AnnotationUtils.findAnnotation(method, Secured.class);
            Assert.notNull(secured, "securedObject did not have @Secured annotation");
            return hasAccessToObject(securedObject, secured.value());
        } catch (NoSuchMethodException ex) {
            throw new IllegalArgumentException("Method " + methodName + " does not exist", ex);
        }
    }
View Full Code Here

Examples of org.springframework.security.access.annotation.Secured

   */
  private void isAllowed(Method mtd) {
    final Annotation[] annotations = mtd.getAnnotations();
    for (final Annotation annotation : annotations) {
      if (annotation instanceof Secured) {
        final Secured secured = (Secured) annotation;
        for (final String rightName : secured.value()) {
          if (!this.userWorkspace.isAllowed(rightName)) {
            throw new SecurityException("Call of this method is not allowed! Missing right: \n\n" + "needed RightName: " + rightName + "\n\n" + "Method: " + mtd);
          }
        }
        return;
View Full Code Here

Examples of org.springframework.security.access.annotation.Secured

public class ComponentMetadataSource implements SecurityMetadataSource {

    @Override
    public Collection<ConfigAttribute> getAttributes(Object componentClass)
            throws IllegalArgumentException {
        Secured secured = (Secured) ((Class)componentClass).getAnnotation(Secured.class);
        if(secured != null) {
            return SecurityConfig.createList(secured.value());
        }
        return null;
    }
View Full Code Here

Examples of org.springframework.security.annotation.Secured

  public Set<SecurityConfig> getAttributes(final Class target) {
    Set<SecurityConfig> attributes = new HashSet<SecurityConfig>();

    for (Annotation annotation : target.getAnnotations()) {
      if (annotation instanceof Secured) {
        Secured attr = (Secured)annotation;
        for (String auth : attr.value()) {
          attributes.add(new SecurityConfig(auth));
        }
        break;
      }
    }
View Full Code Here

Examples of org.springframework.security.annotation.Secured

    Set<SecurityConfig> attributes = new HashSet<SecurityConfig>();

    Annotation[] annotations = AnnotationUtils.getAnnotations(method);
    for (Annotation annotation : annotations) {
      if (annotation instanceof Secured) {
        Secured attr = (Secured)annotation;
        for (String auth : attr.value()) {
          attributes.add(new SecurityConfig(auth));
        }

        break;
      }
View Full Code Here

Examples of org.springframework.security.annotation.Secured

    public Set<SecurityConfig> getAttributes(final Class target) {
        Set<SecurityConfig> attributes = new HashSet<SecurityConfig>();

        for (Annotation annotation : target.getAnnotations()) {
            if (annotation instanceof Secured) {
                Secured attr = (Secured) annotation;
                for (String auth : attr.value()) {
                    attributes.add(new SecurityConfig(auth));
                }
                break;
            }
        }
View Full Code Here

Examples of org.springframework.security.annotation.Secured

        Set<SecurityConfig> attributes = new HashSet<SecurityConfig>();

        Annotation[] annotations = AnnotationUtils.getAnnotations(method);
        for (Annotation annotation : annotations) {
            if (annotation instanceof Secured) {
                Secured attr = (Secured) annotation;
                for (String auth : attr.value()) {
                    attributes.add(new SecurityConfig(auth));
                }

                break;
            }
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.