Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.AccessControlException


                PolicyManager _policyManager = (PolicyManager) this.policyManagerSelector
                        .select(type);

                if (!(_policyManager instanceof InheritingPolicyManager)) {
                    throw new AccessControlException("The " + getClass().getName()
                            + " can only be used with an "
                            + InheritingPolicyManager.class.getName() + ".");
                }

                DefaultAccessController.configureOrParameterize(_policyManager,
View Full Code Here


                if (map.isDocument(webappUrl)) {
                    Document document = map.getFromURL(webappUrl);
                    authorized = WorkflowUtil.canInvoke(this.manager, getLogger(), document, event);
                }
            } catch (final Exception e) {
                throw new AccessControlException(e);
            } finally {
                if (resolver != null) {
                    this.manager.release(resolver);
                }
            }
View Full Code Here

                authorized = authorizeUsecase(usecase, roles, _configurationUri);
            } else {
                getLogger().debug("No usecase to authorize. Granting access.");
            }
        } catch (final ServiceException e) {
            throw new AccessControlException(e);
        } catch (final PublicationException e) {
            throw new AccessControlException(e);
        } catch (final AccessControlException e) {
            throw new AccessControlException(e);
        } finally {
            if (resolver != null) {
                this.manager.release(resolver);
            }
        }
View Full Code Here

        UsecaseRolesBuilder builder = new UsecaseRolesBuilder();
        UsecaseRoles usecaseRoles;
        try {
            usecaseRoles = (UsecaseRoles) getCache().get(_configurationUri, builder);
        } catch (CachingException e) {
            throw new AccessControlException(e);
        }
       
        if (usecaseRoles == null) {
            throw new AccessControlException("Usecase policies configuration not found at [" + _configurationUri + "]");
        }
       
        if (usecaseRoles.hasRoles(usecase)) {

            getLogger().debug("Roles for usecase found.");
View Full Code Here

            for (Enumeration e = request.getParameterNames(); e.hasMoreElements(); ) {
                String key = (String) e.nextElement();
                buf.append("    Parameter: [" + key + "] = [" + request.getParameter(key) + "]\n");
            }
           
            throw new AccessControlException("Request [" + request + "] does not contain roles: \n" + buf.toString());
        }
       
        Role[] roles = (Role[]) roleList.toArray(new Role[roleList.size()]);
        return roles;
    }
View Full Code Here

            if (accessController instanceof Configurable) {
                ((Configurable) accessController).configure(this.accessControllerConfiguration);
            }

        } catch (Exception e) {
            throw new AccessControlException(e);
        }

        return accessController;
    }
View Full Code Here

     */
    public void configure(File _configurationDirectory) throws AccessControlException {
        assert _configurationDirectory != null;

        if (!_configurationDirectory.exists() || !_configurationDirectory.isDirectory()) {
            throw new AccessControlException("The directory ["
                    + _configurationDirectory.getAbsolutePath() + "] does not exist!");
        }

        this.configurationDirectory = _configurationDirectory;
        this.notifier = new DirectoryChangeNotifier(_configurationDirectory, getFileFilter());
View Full Code Here

        boolean changed;
        try {
            changed = this.notifier.hasChanged();
        } catch (IOException e) {
            throw new AccessControlException(e);
        }

        if (changed) {

            if (getLogger().isDebugEnabled()) {
View Full Code Here

                        + " with exception: " + e.fillInStackTrace();

                // an exception occured when trying to instanciate
                // a user.
                getLogger().error(errorMsg);
                throw new AccessControlException(errorMsg, e);
            }
            item.setConfigurationDirectory(this.configurationDirectory);
        }

        try {
            item.configure(config);
        } catch (ConfigurationException e) {
            String errorMsg = "Exception when trying to configure: " + klass;
            throw new AccessControlException(errorMsg, e);
        }
        return item;
    }
View Full Code Here

                    + file.getName();

            // an exception occured when trying to read the configuration
            // from the identity file.
            getLogger().error(errorMsg);
            throw new AccessControlException(errorMsg, e);
        }
        return config;
    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.ac.AccessControlException

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.