Examples of RequiredPermission


Examples of br.gov.frameworkdemoiselle.security.RequiredPermission

   *            the {@code InvocationContext} in which the method is being called
   * @return the resource defined in {@code @RequiredPermission} annotation, the name defined in {@code @Name}
   *         annotation or the class name itself
   */
  private String getResource(InvocationContext ic) {
    RequiredPermission requiredPermission = ic.getMethod().getAnnotation(RequiredPermission.class);

    if (requiredPermission == null || Strings.isEmpty(requiredPermission.resource())) {
      if (ic.getTarget().getClass().getAnnotation(Name.class) == null) {
        return ic.getTarget().getClass().getSimpleName();
      } else {
        return ic.getTarget().getClass().getAnnotation(Name.class).value();
      }
    } else {
      return requiredPermission.resource();
    }
  }
View Full Code Here

Examples of br.gov.frameworkdemoiselle.security.RequiredPermission

   *            the {@code InvocationContext} in which the method is being called
   * @return the operation defined in {@code @RequiredPermission} annotation, the name defined in {@code @Name}
   *         annotation or the method's name itself
   */
  private String getOperation(InvocationContext ic) {
    RequiredPermission requiredPermission = ic.getMethod().getAnnotation(RequiredPermission.class);

    if (requiredPermission == null || Strings.isEmpty(requiredPermission.operation())) {
      if (ic.getMethod().getAnnotation(Name.class) == null) {
        return ic.getMethod().getName();
      } else {
        return ic.getMethod().getAnnotation(Name.class).value();
      }
    } else {
      return requiredPermission.operation();
    }
  }
View Full Code Here

Examples of br.gov.frameworkdemoiselle.security.RequiredPermission

   *            the {@code InvocationContext} in which the method is being called
   * @return the resource defined in {@code @RequiredPermission} annotation, the name defined in {@code @Name}
   *         annotation or the class name itself
   */
  private String getResource(InvocationContext ic) {
    RequiredPermission requiredPermission = ic.getMethod().getAnnotation(RequiredPermission.class);

    if (requiredPermission == null || Strings.isEmpty(requiredPermission.resource())) {
      if (ic.getTarget().getClass().getAnnotation(Name.class) == null) {
        return ic.getTarget().getClass().getSimpleName();
      } else {
        return ic.getTarget().getClass().getAnnotation(Name.class).value();
      }
    } else {
      return requiredPermission.resource();
    }
  }
View Full Code Here

Examples of br.gov.frameworkdemoiselle.security.RequiredPermission

   *            the {@code InvocationContext} in which the method is being called
   * @return the operation defined in {@code @RequiredPermission} annotation, the name defined in {@code @Name}
   *         annotation or the method's name itself
   */
  private String getOperation(InvocationContext ic) {
    RequiredPermission requiredPermission = ic.getMethod().getAnnotation(RequiredPermission.class);

    if (requiredPermission == null || Strings.isEmpty(requiredPermission.operation())) {
      if (ic.getMethod().getAnnotation(Name.class) == null) {
        return ic.getMethod().getName();
      } else {
        return ic.getMethod().getAnnotation(Name.class).value();
      }
    } else {
      return requiredPermission.operation();
    }
  }
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.