Examples of JahiaPrincipal


Examples of org.jahia.jaas.JahiaPrincipal

            if (name != null) {
                if (SYSTEM.equals(name)) {
                    String key = new String(pass);
                    Token token = removeToken(name, key);
                    if (token != null) {
                        principals.add(new JahiaPrincipal(SYSTEM, true, false));
                        principals.add(new SystemPrincipal());
                    }
                } else if (name.startsWith(SYSTEM)) {
                    String key = new String(pass);
                    Token token = removeToken(name, key);
                    if (token != null) {
                        principals.add(new JahiaPrincipal(name.substring(SYSTEM.length()), true, false));
                        principals.add(new SystemPrincipal());
                    }
                } else if (GUEST.equals(name)) {
                    principals.add(new JahiaPrincipal(GUEST, false, true));
                    principals.add(new AnonymousPrincipal());
                } else {
                    String key = new String(pass);
                    Token token = removeToken(name, key);

                    JahiaUser user = null;
                    if (userService != null) {
                        user = userService.lookupUser(name);
                    } else {
                        // this can happen if we are still starting up.
                        user = JCRUserManagerProvider.getInstance().lookupUser(name);
                    }

                    if ((token != null) || user.verifyPassword(key)) {
                        principals.add(new JahiaPrincipal(name));
                        if (user.isAdminMember(0)) {
                            principals.add(new AdminPrincipal(name));
                        }
                    }
                }
View Full Code Here

Examples of org.jahia.services.usermanager.JahiaPrincipal

                    if (workflowAction instanceof WorkflowTask) {
                        WorkflowTask workflowTask = (WorkflowTask) workflowAction;
                        List<WorkflowParticipation> participations = workflowTask.getParticipations();
                        if (participations != null) {
                            for (WorkflowParticipation participation : participations) {
                                JahiaPrincipal principal = participation.getJahiaPrincipal();
                                if ((principal instanceof JahiaGroup && ((JahiaGroup) principal).isMember(session.getUser())) ||
                                    (principal instanceof JahiaUser && ((JahiaUser) principal).getUserKey().equals(session.getUser().getUserKey()))) {
                                    gwtWf.getAvailableTasks().add(getGWTJahiaWorkflowTask(workflowTask));
                                    break;
                                }
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.