Examples of checkPermission()


Examples of org.apache.jackrabbit.core.SessionImpl.checkPermission()

            Node node = session.getNodeByUUID( content.getId() );
           
            AbstractContentImpl abstractContent = (AbstractContentImpl) content;
            SessionImpl jackrabbitSession = (SessionImpl) node.getSession();
            try {
                jackrabbitSession.checkPermission(node.getPath(), SessionImpl.ADD_NODE_ACTION);
                abstractContent.setModifiable(true);
            } catch (AccessControlException ace) {
                abstractContent.setModifiable(false);
            }
            try {
View Full Code Here

Examples of org.apache.jackrabbit.core.security.AccessManager.checkPermission()

        if (perm > Permission.NONE) {
            SessionImpl sImpl = (SessionImpl) item.getSession();
            AccessManager acMgr = sImpl.getAccessManager();

            Path path = item.getPrimaryPath();
            acMgr.checkPermission(path, perm);
        }
    }

    private void checkPermission(NodeImpl node, Name childName, int perm) throws RepositoryException {
        if (perm > Permission.NONE) {
View Full Code Here

Examples of org.apache.jackrabbit.core.security.AccessManager.checkPermission()

        if (perm > Permission.NONE) {
            SessionImpl sImpl = (SessionImpl) item.getSession();
            AccessManager acMgr = sImpl.getAccessManager();

            Path path = item.getPrimaryPath();
            acMgr.checkPermission(path, perm);
        }
    }

    private void checkPermission(NodeImpl node, Name childName, int perm) throws RepositoryException {
        if (perm > Permission.NONE) {
View Full Code Here

Examples of org.apache.myfaces.extensions.cdi.core.api.security.AbstractAccessDecisionVoter.checkPermission()

            if (bean == null) {
                return false;
            }
            InvocationContext ic = new InvocationContextImpl(secureComponentData
                    .getTargetComponent(), contextParameters);
            Set<SecurityViolation> securityViolations = bean.checkPermission(ic);

            partialResult = securityViolations.isEmpty();
            if (secureComponentData.isNot()) {
                partialResult = !partialResult;
            }
View Full Code Here

Examples of org.apache.myfaces.extensions.cdi.core.api.security.AccessDecisionVoter.checkPermission()

        AccessDecisionVoter voter;
        for(Class<? extends AccessDecisionVoter> voterClass : accessDecisionVoters)
        {
            voter = getOrCreateScopedInstanceOfBeanByClass(beanManager, voterClass);

            violations = voter.checkPermission(invocationContext);

            if(violations != null && violations.size() > 0)
            {
                throw new AccessDeniedException(violations, errorView);
            }
View Full Code Here

Examples of org.apache.roller.weblogger.business.UserManager.checkPermission()

    public boolean isUserIsAdmin() {
        try {
            GlobalPermission adminPerm = new GlobalPermission(
                Collections.singletonList(GlobalPermission.ADMIN));
            UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
            return umgr.checkPermission(adminPerm, getAuthenticatedUser());
        } catch (Exception e) {}
        return false;
    }
   
   
View Full Code Here

Examples of org.apache.shiro.subject.Subject.checkPermission()

        UsernamePasswordToken token = new UsernamePasswordToken(u1.getUsername(), password);
        subject.login(token);

        Assert.assertTrue(subject.isAuthenticated());
        subject.checkRole("admin");
        subject.checkPermission("user:create");

        userService.changePassword(u1.getId(), password + "1");
        userRealm.clearCache(subject.getPrincipals());

        token = new UsernamePasswordToken(u1.getUsername(), password + "1");
View Full Code Here

Examples of org.apache.shiro.subject.Subject.checkPermission()

public class PermissionServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Subject subject = SecurityUtils.getSubject();
        subject.checkPermission("user:create");
        req.getRequestDispatcher("/WEB-INF/jsp/hasPermission.jsp").forward(req, resp);
    }
}
View Full Code Here

Examples of org.apache.wiki.auth.AuthorizationManager.checkPermission()

       
        if ( CREATE_GROUPS.equals( permission ) || CREATE_PAGES.equals( permission )
            || EDIT_PREFERENCES.equals( permission ) || EDIT_PROFILE.equals( permission )
            || LOGIN.equals( permission ) )
        {
            gotPermission = mgr.checkPermission( session, new WikiPermission( page.getWiki(), permission ) );
        }
        else if ( VIEW_GROUP.equals( permission )
            || EDIT_GROUP.equals( permission )
            || DELETE_GROUP.equals( permission ) )
        {
View Full Code Here

Examples of org.apache.wiki.auth.AuthorizationManager.checkPermission()

                }
                else if ( DELETE_GROUP.equals( permission ) )
                {
                    action = "delete";
                }
                gotPermission = mgr.checkPermission( session, new GroupPermission( groupName, action ) );
            }
        }
        else if ( ALL_PERMISSION.equals( permission ) )
        {
            gotPermission = mgr.checkPermission( session, new AllPermission( m_wikiContext.getEngine().getApplicationName() ) );
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.