Package org.apache.shiro.authz.annotation

Examples of org.apache.shiro.authz.annotation.RequiresUser


    boolean requiresUser = false;

    try
    {
      RequiresUser annotation = runtimeClass.getAnnotation(RequiresUser.class);
      requiresUser = (annotation != null);
    }
    catch (NullPointerException e)
    {
      requiresUser = false;
    }

    if (requiresUser && !(ApplicationSecurity.isRemembered() || ApplicationSecurity.isAuthenticated()))
    {
      final String message = String.format("Authentication failed for %s on %s", userName, viewName);
      logger.warn(message);
      throw new AuthenticationException(message);
    }

    try
    {
      RequiresUser annotation = method.getAnnotation(RequiresUser.class);
      requiresUser = (annotation != null);
    }
    catch (NullPointerException e)
    {
      requiresUser = false;
View Full Code Here

TOP

Related Classes of org.apache.shiro.authz.annotation.RequiresUser

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.