Package org.jboss.seam.security

Examples of org.jboss.seam.security.AuthorizationException


        return readAccessLevel;
    }

    public void setReadAccessLevel(Role.AccessLevel readAccessLevel) {
        if (!Identity.instance().hasPermission("Node", "changeAccessLevel", getInstance()) ) {
            throw new AuthorizationException("You don't have permission for this operation");
        }
        this.readAccessLevel = readAccessLevel;
        getInstance().setReadAccessLevel(
            readAccessLevel != null ? readAccessLevel.getAccessLevel() : Role.ADMINROLE_ACCESSLEVEL
        );
View Full Code Here


    WikiNodeDAO wikiNodeDAO;

    @Create
    public void create() {
        if (!Identity.instance().hasPermission("User", "isAdmin", (User)Component.getInstance("currentUser") ) ) {
            throw new AuthorizationException("You don't have permission for this operation");
        }
    }
View Full Code Here

    // We don't care if a user is logged in, just check it...
    public void checkRestriction(String expr) {
        if (!evaluateExpression(expr)) {
            Events.instance().raiseEvent("org.jboss.seam.notAuthorized");
            throw new AuthorizationException(String.format(
                    "Authorization check failed for expression [%s]", expr));
        }
    }
View Full Code Here

         }
      }
     
      if (!authorized)
      {
         throw new AuthorizationException(
               "Failed to process authorization request - no matching authorizer " +
               "method for specified binding type [" + binding.annotationType().getClass().getName() + "]");
      }
   }
View Full Code Here

         Object result = injectableMethod.invoke(reference, cc, null);
        
         if (result.equals(Boolean.FALSE))
         {
            throw new AuthorizationException("Authorization check failed");
         }
      }
View Full Code Here

    class MockFeedServlet extends FeedServlet {
        boolean throwAuthException = false;
        @Override
        void checkCategoryPermission(String cat) {
            if (throwAuthException) throw new AuthorizationException("NO");
            super.checkCategoryPermission(cat);    //To change body of overridden methods use File | Settings | File Templates.
        }
View Full Code Here

            super.checkCategoryPermission(cat);    //To change body of overridden methods use File | Settings | File Templates.
        }

        @Override
        void checkPackageReadPermission(String packageName) {
            if (throwAuthException) throw new AuthorizationException("NO");
            super.checkPackageReadPermission(packageName);    //To change body of overridden methods use File | Settings | File Templates.
        }
View Full Code Here

        }

        List<RoleBasedPermission> permissions = roleBasedPermissionManager.getRoleBasedPermission();
        if ( permissions.size() == 0 ) {
            identity.logout();
            throw new AuthorizationException( "This user has no permissions setup." );
        }

        if ( invalidSecuritySerializationSetup() ) {
            identity.logout();
            throw new AuthorizationException( " Configuration error - Please refer to the Administration Guide section on installation. You must configure a key store before proceding.  " );
        }
        return new CapabilityCalculator().calcCapabilities( permissions );
    }
View Full Code Here

        }
       
        List<RoleBasedPermission> permissions = roleBasedPermissionManager.getRoleBasedPermission();
        if ( permissions.size() == 0 ) {
            identity.logout();
            throw new AuthorizationException( "This user has no permissions setup." );
        }

        if ( invalidSecuritySerializationSetup() ) {
            identity.logout();
            throw new AuthorizationException( " Configuration error - Please refer to the Administration Guide section on installation. You must configure a key store before proceding.  " );
        }
        return new CapabilityCalculator().calcCapabilities( permissions );
    }
View Full Code Here

            List<RoleBasedPermission> permissions = permManager.getRoleBasedPermission();
            if ( permissions.size() == 0 ) {
                RoleBasedPermissionResolver resolver = (RoleBasedPermissionResolver) Component.getInstance( "org.jboss.seam.security.roleBasedPermissionResolver" );
                if ( resolver.isEnableRoleBasedAuthorization() ) {
                    Identity.instance().logout();
                    throw new AuthorizationException( "This user has no permissions setup." );
                }
            }
            return c.calcCapabilities( permissions,
                                       PREFERENCES );
        } else {
View Full Code Here

TOP

Related Classes of org.jboss.seam.security.AuthorizationException

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.