Examples of checkPermission()


Examples of java.security.AccessControlContext.checkPermission()

            Permission permission = new EJBMethodPermission(ejbName, name, method);

            AccessControlContext accessContext = ContextManager.getCurrentContext();

            if (permission != null) accessContext.checkPermission(permission);

        } catch (AccessControlException e) {
            return false;
        }
        return true;
View Full Code Here

Examples of java.security.AccessControlContext.checkPermission()

        String EJBName = deploymentInfo.getEjbName();
        if (EJBName == null) throw new IllegalArgumentException("EJBName must not be null");
        try {
            AccessControlContext context = ContextManager.getCurrentContext();
            context.checkPermission(new EJBRoleRefPermission(EJBName, role));
        } catch (AccessControlException e) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of java.security.AccessControlContext.checkPermission()

            return false;
        }

        AccessControlContext acc = ((JACCUserIdentity)userIdentity).getAccessControlContext();
        try {
            acc.checkPermission(new WebResourcePermission(request));
            return true;
        } catch (AccessControlException e) {
            return false;
        }
    }
View Full Code Here

Examples of java.security.AccessControlContext.checkPermission()

         */
        if (name == null || name.equals("jsp")) {
            name = "";
        }
        try {
            acc.checkPermission(new WebRoleRefPermission(name, role));
            return true;
        } catch (AccessControlException e) {
            return false;
        }
    }
View Full Code Here

Examples of java.security.AccessControlContext.checkPermission()

            servletName = "";
        }
        try {
            //correct run-as identity available from context manager.
            AccessControlContext acc = ContextManager.getCurrentContext();
            acc.checkPermission(new WebRoleRefPermission(servletName, role));
            return true;
        } catch (AccessControlException e) {
            return false;
        }
    }
View Full Code Here

Examples of java.security.AccessControlContext.checkPermission()

            // JACC v1.0 secion B.19
            String servletName = InternalJettyServletHolder.getCurrentServletName();
            if (servletName == null || servletName.equals("jsp")) {
                servletName = "";
            }
            acc.checkPermission(new WebRoleRefPermission(servletName, role));
        } catch (AccessControlException e) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of java.security.acl.AclEntry.checkPermission()

  public boolean checkPermission(Principal user,
                                 java.security.acl.Permission perm) {
        for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
          AclEntry ent = e.nextElement();
          if (ent.getPrincipal().equals(user))
                if (ent.checkPermission(perm)) return true;
        }
        return false;
  }

  /**
 
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()

                break;
            }
        }

        // check that all 4 permissions are granted/denied correctly
        session.checkPermission(thePath, "read");

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

Examples of javax.jcr.Session.checkPermission()

        // check that all 4 permissions are granted/denied correctly
        session.checkPermission(thePath, "read");

        try {
            session.checkPermission(thePath + "/" + nodeName1, "add_node");
            fail("add_node permission on \"" + thePath + "/" + nodeName1 + "\" granted to read-only Session");
        } catch (AccessControlException success) {
            // ok
        }
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.