Examples of checkPermission()


Examples of javax.jcr.Session.checkPermission()

        } catch (AccessControlException success) {
            // ok
        }

        try {
            session.checkPermission(thePath + "/" + propertyName1, "set_property");
            fail("set_property permission on \"" + thePath + "/" + propertyName1 + "\" granted to read-only Session");
        } catch (AccessControlException success) {
            // ok
        }
View Full Code Here

Examples of javax.jcr.Session.checkPermission()

        } catch (AccessControlException success) {
            // ok
        }

        try {
            session.checkPermission(thePath, "remove");
            fail("remove permission on \"" + thePath + "\" granted to read-only Session");
        } catch (AccessControlException success) {
            // ok
        }
View Full Code Here

Examples of javax.jcr.Session.checkPermission()

          testuser must have READ-only permission on the root node and below
        */
        Session testSession = getTestSession();
        String rootPath = testSession.getRootNode().getPath();
        checkReadOnly(rootPath);
        testSession.checkPermission(rootPath + "nonExistingItem", javax.jcr.Session.ACTION_READ);
    }

    public void testACItemsAreProtected() throws NotExecutableException, RepositoryException {
        // search for a rep:policy node
        Node policyNode = findPolicyNode(superuser.getRootNode());
View Full Code Here

Examples of javax.jcr.Session.checkPermission()

     * instead of AccessControlException
     */
    public void testCheckAddNodePermissionOnRoot() throws RepositoryException {
        Session session = getHelper().getReadOnlySession();
        try {
            session.checkPermission("/", "add_node");
        } catch (PathNotFoundException e) {
            fail("JCR-1731: Session.checkPermission(\"/\", \"add_node\")"
                    + " throws PathNotFoundException instead of"
                    + " AccessControlException");
        } catch (AccessControlException e) {
View Full Code Here

Examples of javax.jcr.Session.checkPermission()

          testuser must have READ-only permission on the root node and below
        */
        Session testSession = getTestSession();
        String rootPath = testSession.getRootNode().getPath();
        checkReadOnly(rootPath);
        testSession.checkPermission(rootPath + "nonExistingItem", javax.jcr.Session.ACTION_READ);
    }

    public void testACItemsAreProtected() throws NotExecutableException, RepositoryException {
        // search for a rep:policy node
        Node policyNode = findPolicyNode(superuser.getRootNode());
View Full Code Here

Examples of jenkins.model.Jenkins.checkPermission()

    /**
     * Bare-minimum configuration mechanism to change the update center.
     */
    public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException {
        Jenkins hudson = Jenkins.getInstance();
        hudson.checkPermission(Jenkins.ADMINISTER);
        UpdateCenter uc = hudson.getUpdateCenter();
        PersistedList<UpdateSite> sites = uc.getSites();
        for (UpdateSite s : sites) {
            if (s.getId().equals("default"))
                sites.remove(s);
View Full Code Here

Examples of jenkins.model.Jenkins.checkPermission()

    }


    public HttpResponse doProxyConfigure(StaplerRequest req) throws IOException, ServletException {
        Jenkins jenkins = Jenkins.getInstance();
        jenkins.checkPermission(Jenkins.ADMINISTER);

        ProxyConfiguration pc = req.bindJSON(ProxyConfiguration.class, req.getSubmittedForm());
        if (pc.name==null) {
            jenkins.proxy = null;
            ProxyConfiguration.getXmlFile().delete();
View Full Code Here

Examples of net.sourceforge.processdash.security.DashboardPermission.checkPermission()

  }

  protected static void checkPermission(String action) {
      if (System.getSecurityManager() != null) {
         DashboardPermission p = new DashboardPermission("settings."+action);
         p.checkPermission();
      }
  }

}
View Full Code Here

Examples of net.timewalker.ffmq3.local.connection.LocalConnection.checkPermission()

                        throw new FFMQException("Access denied to administration queue "+queueName,"ACCESS_DENIED");
                }
                else
                if (queueName.equals(FFMQConstants.ADM_REPLY_QUEUE))
                {
                    conn.checkPermission(Resource.SERVER, Action.REMOTE_ADMIN);
                }
                else
                {
                    // Standard queue
                    conn.checkPermission(destination,Action.CONSUME);
View Full Code Here

Examples of org.apache.deltaspike.security.api.authorization.AccessDecisionVoter.checkPermission()

            AccessDecisionVoter voter;
            for (Class<? extends AccessDecisionVoter> voterClass : accessDecisionVoters)
            {
                voter = BeanProvider.getContextualReference(voterClass, false);

                violations = voter.checkPermission(voterContext);

                if (violations != null && violations.size() > 0)
                {
                    if (voterContext instanceof EditableAccessDecisionVoterContext)
                    {
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.