Package org.jahia.services.usermanager

Examples of org.jahia.services.usermanager.JahiaGroup.addMember()


                        adminGroup = jgms.createGroup(site.getID(), JahiaGroupManagerService.SITE_ADMINISTRATORS_GROUPNAME, null,
                                false);
                    }

                    // attach superadmin user (current) to administrators group...
                    adminGroup.addMember(currentUser);

                    if (!siteKey.equals(SYSTEM_SITE_KEY)) {
                        JahiaGroup sitePrivGroup = jgms.lookupGroup(site.getID(),
                                JahiaGroupManagerService.SITE_PRIVILEGED_GROUPNAME);
                        if (sitePrivGroup == null) {
View Full Code Here


            p = groupService.lookupGroup(site.getID(), principal.substring(2));
        }
        if (p != null) {
            if (needPrivileged && !priv.isMember(p)) {
                logger.info(principal + " need privileged access");
                priv.addMember(p);
            } else if (!needPrivileged && priv.isMember(p)) {
                logger.info(principal + " do not need privileged access");
                priv.removeMember(p);
            }
        }
View Full Code Here

        JahiaUser readOnlyUser = JCRUserManagerProvider.getInstance().lookupUser(readonly.getUserID());
        if (readOnlyUser == null) {
            readOnlyUser = JCRUserManagerProvider.getInstance().createUser(readonly.getUserID(), new String(readonly.getPassword()), new Properties());
            ((JCRSessionWrapper)session).getRootNode().grantRoles("u:"+readonly.getUserID(), Collections.singleton("privileged"));
            JahiaGroup usersGroup = JCRGroupManagerProvider.getInstance().lookupGroup(JahiaGroupManagerService.USERS_GROUPNAME);
            usersGroup.addMember(readOnlyUser);
        }
       
        JahiaTestContentLoader loader = new JahiaTestContentLoader();
        loader.loadTestContent(session);
    }
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.