Package java.security

Examples of java.security.Permission


            InterfaceType type = deploymentInfo.getInterfaceType(method.getDeclaringClass());

            String name = (type == null)? null: type.getSpecName();

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

            AccessControlContext accessContext = ContextManager.getCurrentContext();

            if (permission != null) accessContext.checkPermission(permission);
View Full Code Here


                securityHolder.setExcluded(componentPermissions.getExcludedPermissions());
                PermissionCollection checkedPermissions = new Permissions();
                for (Iterator iterator = rolePermissions.values().iterator(); iterator.hasNext();) {
                    PermissionCollection permissionsForRole = (PermissionCollection) iterator.next();
                    for (Enumeration iterator2 = permissionsForRole.elements(); iterator2.hasMoreElements();) {
                        Permission permission = (Permission) iterator2.nextElement();
                        checkedPermissions.add(permission);
                    }
                }
                securityHolder.setChecked(checkedPermissions);
                earContext.addSecurityContext(policyContextID, componentPermissions);
View Full Code Here

        if (path == null) {
            return;
        }

        if (securityManager != null) {
            Permission permission = null;
            if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                if (!path.endsWith("/")) {
                    path = path + "/";
                }
                permission = new JndiPermission(path + "*");
 
View Full Code Here

        if ((pc = (PermissionCollection)loaderPC.get(codeUrl)) == null) {
            pc = super.getPermissions(codeSource);
            if (pc != null) {
                Iterator perms = permissionList.iterator();
                while (perms.hasNext()) {
                    Permission p = (Permission)perms.next();
                    pc.add(p);
                }
                loaderPC.put(codeUrl,pc);
            }
        }
View Full Code Here

     * @param panel         Panel where action is to be invoked
     */
    protected void checkMethodSecurity(String methodName, Class permissionClass, String action, Panel panel) {
        try {
            Method instanceCreator = permissionClass.getMethod("newInstance", new Class[]{Object.class, String.class});
            Permission perm = (Permission) instanceCreator.invoke(null, new Object[]{getResourceForPermission(permissionClass, action, panel), action});
            UserStatus.lookup().checkPermission(perm);
        } catch (NoSuchMethodException e) {
            log.error("Error checking permission " + permissionClass.getName() + "[" + action + "] for method " + methodName + ":", e);
        } catch (IllegalAccessException e) {
            log.error("Error checking permission " + permissionClass.getName() + "[" + action + "] for method " + methodName + ":", e);
View Full Code Here

     * @return true if the user is allowed to execute the method.
     */
    protected boolean hasMethodAccess(String methodName, Class permissionClass, String action, Panel panel) {
        try {
            Method instanceCreator = permissionClass.getMethod("newInstance", new Class[]{Object.class, String.class});
            Permission perm = (Permission) instanceCreator.invoke(null, new Object[]{getResourceForPermission(permissionClass, action, panel), action});
            return UserStatus.lookup().hasPermission(perm);
        } catch (NoSuchMethodException e) {
            log.error("Error checking permission " + permissionClass.getName() + "[" + action + "] for method " + methodName + ":", e);
        } catch (IllegalAccessException e) {
            log.error("Error checking permission " + permissionClass.getName() + "[" + action + "] for method " + methodName + ":", e);
View Full Code Here

        if (path == null) {
            return;
        }

        if (securityManager != null) {
            Permission permission = null;
            if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                if (!path.endsWith("/")) {
                    path = path + "/";
                }
                permission = new JndiPermission(path + "*");
 
View Full Code Here

        if ((pc = (PermissionCollection)loaderPC.get(codeUrl)) == null) {
            pc = super.getPermissions(codeSource);
            if (pc != null) {
                Iterator perms = permissionList.iterator();
                while (perms.hasNext()) {
                    Permission p = (Permission)perms.next();
                    pc.add(p);
                }
                loaderPC.put(codeUrl,pc);
            }
        }
View Full Code Here

        if (path == null) {
            return;
        }

        if (securityManager != null) {
            Permission permission = null;
            if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                if (!path.endsWith("/")) {
                    path = path + "/";
                }
                permission = new JndiPermission(path + "*");
 
View Full Code Here

        if ((pc = (PermissionCollection)loaderPC.get(codeUrl)) == null) {
            pc = super.getPermissions(codeSource);
            if (pc != null) {
                Iterator perms = permissionList.iterator();
                while (perms.hasNext()) {
                    Permission p = (Permission)perms.next();
                    pc.add(p);
                }
                loaderPC.put(codeUrl,pc);
            }
        }
View Full Code Here

TOP

Related Classes of java.security.Permission

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.