Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.UserManager


            Identifiable[] identifiables = identity.getIdentifiables();
            for (int i = 0; i < identifiables.length; i++) {
                identity.removeIdentifiable(identifiables[i]);
            }

            UserManager userManager = ((DefaultAccessController) controller)
                    .getAccreditableManager().getUserManager();
            if (this.userId != null) {
                User user = userManager.getUser(this.userId);

                if (user == null) {
                    throw new RuntimeException("User [" + this.userId + "] does not exist!");
                }
View Full Code Here


    /**
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
     */
    protected void doExecute() throws Exception {
        UserManager userManager = (FileUserManager) getUserManager();

        String userId = getParameterAsString(UserProfile.USER_ID).toLowerCase();
        String fullName = getParameterAsString(UserProfile.FULL_NAME);
        String description = getParameterAsString(UserProfile.DESCRIPTION);
        String email = getParameterAsString(UserProfile.EMAIL);
View Full Code Here

            selector = (ServiceSelector) this.manager.lookup(AccessControllerResolver.ROLE
                    + "Selector");
            acResolver = (AccessControllerResolver) selector.select(AccessControllerResolver.DEFAULT_RESOLVER);
            accessController = acResolver.resolveAccessController(getSourceURL());

            UserManager userManager = accessController.getAccreditableManager().getUserManager();
            user = userManager.getUser(userId);

        } finally {
            if (selector != null) {
                if (acResolver != null) {
                    if (accessController != null) {
View Full Code Here

    /**
     * Run the test
     * @throws AccessControlException if an error occurs
     */
    final public void testInstance() throws AccessControlException {
        UserManager _manager = getAccreditableManager().getUserManager();
        assertNotNull(_manager);
    }
View Full Code Here

        adminGroup.save();
        adminGroup.add(user);
        user.save();

        FileGroupManager groupManager = null;
        UserManager userManager = getAccreditableManager().getUserManager();
        assertNotNull(userManager);

        groupManager = FileGroupManager.instance(getAccreditableManager(), configDir, getLogger());
        assertNotNull(groupManager);
View Full Code Here

            Role[] roles = policyManager.getGrantedRoles(controller.getAccreditableManager(), getIdentity(), URLS[i]);
            assertTrue(roles.length > 0);

            User[] users = PolicyUtil.getUsersWithRole(getManager(), URLS[i], "review", getLogger());
           
            UserManager userManager = controller.getAccreditableManager().getUserManager();
            User lenya = userManager.getUser("lenya");
            User alice = userManager.getUser("alice");
           
            List usersList = Arrays.asList(users);
            assertFalse(usersList.contains(lenya));
            assertTrue(usersList.contains(alice));
        }
View Full Code Here

        closeIndexer();

        try {
            Session session = RepositoryUtil.getSession(this.manager, this.request);
            User sender = session.getIdentity().getUser();
            UserManager userManager = (UserManager) sender.getItemManager();
            User recipient = userManager.getUser(this.notificationRecipient);
            Identifiable[] recipients = { recipient };

            String subject = "indexing-failed-subject";
            String[] subjectParams = new String[0];
            String body = "indexing-failed-body";
View Full Code Here

                user = identity.getUser();
            }
        } else {
            String userId = parameters[1];
            if (!userId.equals("")) {
                UserManager userManager = (UserManager) getItemManager(request, USER_MANAGER);
                user = userManager.getUser(userId);
            }
        }
        return user;
    }
View Full Code Here

     */
    public User[] getUsersWithRole(String roleId) throws ProcessingException {
        List users = new ArrayList();
        try {
            Policy policy = policyManager.getPolicy(accessController.getAccreditableManager(), getUrl());
            UserManager userManager = accessController.getAccreditableManager().getUserManager();
            User[] userArray = userManager.getUsers();
            for (int i = 0; i < userArray.length; i++ ) {
                Identity identity = new Identity();
                identity.addIdentifiable(userArray[i]);
                Role[] roles = policy.getRoles(identity);
                for (int roleIndex = 0; roleIndex < roles.length; roleIndex++) {
View Full Code Here

    public User[] getUsersWithRole(String roleId) throws ProcessingException {
        List users = new ArrayList();
        try {
            Policy policy =
                policyManager.getPolicy(accessController.getAccreditableManager(), getUrl());
            UserManager userManager = accessController.getAccreditableManager().getUserManager();
            User[] userArray = userManager.getUsers();
            for (int i = 0; i < userArray.length; i++) {
                Identity identity = new Identity();
                identity.addIdentifiable(userArray[i]);
                Role[] roles = policy.getRoles(identity);
                for (int roleIndex = 0; roleIndex < roles.length; roleIndex++) {
View Full Code Here

TOP

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

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.