Examples of AuthorizationException


Examples of org.jboss.seam.security.AuthorizationException

        getLog().debug("rating comment with id: " + commentId + " as " + rating);

        // Only the owner of the document can rate comments of that document
        if ( !currentUser.getId().equals(documentHome.getInstance().getCreatedBy().getId()) ) {
            throw new AuthorizationException("You don't have permission for this operation");
        }

        // Guest can't rate
        if (currentUser.isGuest()) {
            throw new IllegalStateException("User interface bug, guests can't rate comments");
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

            throw new InvalidWikiRequestException("Could not find parent node with id: " + parentNodeId);
        getLog().debug("initalized with parent node: " + parentNode);

        // Check write access level of the parent node, if the user wants to create a new node
        if (!isPersistAllowed(node, parentNode))
            throw new AuthorizationException("You don't have permission for this operation");

        // Default to same access permissions as parent node
        node.setWriteAccessLevel(parentNode.getWriteAccessLevel());
        node.setReadAccessLevel(parentNode.getReadAccessLevel());
        writeAccessLevel = getAccessLevelsList().get(
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

    public N beforeNodeEditFound(N node) {

        // Check write access level of the node the user wants to edit
        if (!isUpdateAllowed(node, null))
            throw new AuthorizationException("You don't have permission for this operation");

        writeAccessLevel = getAccessLevelsList().get(
            accessLevelsList.indexOf(
                new Role.AccessLevel(node.getWriteAccessLevel())
            )
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

    }

    protected void checkPersistPermissions() {
        getLog().debug("checking persist permissions");
        if (!isPersistAllowed(getInstance(), getParentNode()))
            throw new AuthorizationException("You don't have permission for this operation");
    }
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

    }

    protected void checkUpdatePermissions() {
        getLog().debug("checking update permissions");
        if (!isUpdateAllowed(getInstance(), getParentNode()))
            throw new AuthorizationException("You don't have permission for this operation");
    }
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

    }

    protected void checkRemovePermissions() {
        getLog().debug("checking remove permissions");
        if (!isRemoveAllowed(getInstance(), getParentNode()))
            throw new AuthorizationException("You don't have permission for this operation");
    }
View Full Code Here

Examples of org.jboss.seam.security.AuthorizationException

        return writeAccessLevel;
    }

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

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

Examples of org.jboss.seam.security.AuthorizationException

    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

Examples of org.jboss.seam.security.AuthorizationException

    // 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
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.