Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.AccessControlException


            if (accessController instanceof Configurable) {
                ((Configurable) accessController).configure(configuration);
            }

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

        return accessController;
    }
View Full Code Here


            resolver = (SourceResolver) getManager().lookup(SourceResolver.ROLE);
            contextSource = resolver.resolveURI("context:///");
            contextDir = SourceUtil.getFile(contextSource);

            if (contextDir == null || !contextDir.isDirectory()) {
                throw new AccessControlException("The servlet context is not a directory!");
            }

        } finally {
            if (resolver != null) {
                if (contextSource != null) {
View Full Code Here

            getLogger().debug(
                    "Authenticating username [" + username + "] with password [" + password + "]");
        }

        if (username == null || password == null) {
            throw new AccessControlException("Username or password is null!");
        }

        Identity identity = (Identity) request.getSession(false).getAttribute(
                Identity.class.getName());

        if (identity == null) {
            throw new AccessControlException("The session does not contain the identity!");
        }

        boolean authenticated = authenticate(accreditableManager, username, password, identity);
        return authenticated;
    }
View Full Code Here

      exists = (entry != null);

        } catch (Exception e) {
      if (log.isDebugEnabled())
    log.debug("existsUser() for id " + ldapId + " got exception: " + e);
            throw new AccessControlException("Exception during search: ", e);
        }

        return exists;
    }
View Full Code Here

    public void removeRole(Accreditable accreditable, Role role) throws AccessControlException {
        assert accreditable != null;
        assert role != null;
        Credential credential = getCredential(accreditable);
        if (credential == null) {
            throw new AccessControlException(
                "No credential for accreditable ["
                    + accreditable
                    + "] ["
                    + accreditableToCredential.keySet().size()
                    + "]");
        }
        if (!credential.contains(role)) {
            throw new AccessControlException(
                "Credential for accreditable ["
                    + accreditable
                    + "] does not contain role ["
                    + role
                    + "]");
View Full Code Here

   * @param credential The credential to remove.
   * @throws AccessControlException If the credential does not exist.
   */
    protected void removeCredential(Credential credential) throws AccessControlException {
        if (!accreditableToCredential.containsValue(credential)) {
            throw new AccessControlException("Credential [" + credential + "] does not exist!");
        }
        accreditableToCredential.remove(credential.getAccreditable());
    }
View Full Code Here

        Configuration config = createConfiguration();

        try {
            serializer.serializeToFile(getFile(), config);
        } catch (Exception e) {
            throw new AccessControlException(e);
        }
    }
View Full Code Here

        boolean authorized = false;

        UsecaseRoles usecaseRoles = getUsecaseRoles(_configurationUri);

        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

        }
        UsecaseRolesBuilder builder = new UsecaseRolesBuilder();
        try {
            builder.save(usecaseRoles, configUri, this.manager);
        } catch (BuildException e) {
            throw new AccessControlException(e);
        }
    }
View Full Code Here

            }

            Role[] roles = PolicyUtil.getRoles(request);
            authorized = authorizeUsecase(usecase, roles, _configurationUri);
        } catch (final PublicationException e) {
            throw new AccessControlException(e);
        } catch (final AccessControlException e) {
            throw new AccessControlException(e);
        }

        return authorized;
    }
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.