Package org.apache.roller.business

Examples of org.apache.roller.business.UserManager.savePermissions()


        perm = new PermissionsData();
        perm.setUser(testUser);
        perm.setWebsite(testWeblog);
        perm.setPending(false);
        perm.setPermissionMask(PermissionsData.ADMIN);
        mgr.savePermissions(perm);
        TestUtils.endSession(true);
       
        // check that create was successful
        perm = null;
        perm = mgr.getPermissions(testWeblog, testUser);
View Full Code Here


        assertNotNull(perm);
        assertEquals(PermissionsData.ADMIN, perm.getPermissionMask());
       
        // update permissions
        perm.setPermissionMask(PermissionsData.LIMITED);
        mgr.savePermissions(perm);
        TestUtils.endSession(true);
       
        // check that update was successful
        perm = null;
        perm = mgr.getPermissions(testWeblog, testUser);
View Full Code Here

        perm = new PermissionsData();
        perm.setUser(user);
        perm.setWebsite(testWeblog);
        perm.setPending(true);
        perm.setPermissionMask(PermissionsData.AUTHOR);
        mgr.savePermissions(perm);
       
        // get pending permissions for a user
        perms = mgr.getPendingPermissions(testUser);
        assertEquals(0, perms.size());
        perms = mgr.getPendingPermissions(user);
View Full Code Here

        TestUtils.endSession(true);
       
        // accept invitation
        perm = mgr.getPermissions(testWeblog, user);
        perm.setPending(false);
        mgr.savePermissions(perm);
        TestUtils.endSession(true);
       
        // re-query now that we have changed things
        user = mgr.getUserByUserName(user.getUserName());
        testWeblog = mgr.getWebsiteByHandle(testWeblog.getHandle());
View Full Code Here

                        if (val == -1) {
                            userMgr.removePermissions(perms);
                            removed++;
                        } else {
                            perms.setPermissionMask(val);
                            userMgr.savePermissions(perms);
                            changed++;
                        }
                    }
                }
            }
View Full Code Here

           
            List permissionsDatas= new ArrayList();
            for (int i = 0; i < c.getEntries().length; i++) {
                MemberEntry entry = (MemberEntry)c.getEntries()[i];
                PermissionsData pd = toPermissionsData(entry);
                mgr.savePermissions(pd);
                getRoller().flush();
                CacheManager.invalidate(pd.getUser());
                CacheManager.invalidate(pd.getWebsite());
                permissionsDatas.add(pd);
            }
View Full Code Here

        try {
            UserData ud = getUserData(entry.getName());
            WebsiteData wd = getWebsiteData(entry.getHandle());
           
            UserManager mgr = getRoller().getUserManager();
            mgr.savePermissions(pd);
            getRoller().flush();
            CacheManager.invalidate(ud);
            CacheManager.invalidate(wd);
        } catch (RollerException re) {
            throw new InternalException("ERROR: Could not update permissions data", re);
View Full Code Here

        PermissionsData perms = userMgr.getPermissions(form.getInviteId());
        if (perms != null) {       
            // TODO ROLLER_2.0: notify inviter that invitee has accepted invitation
            // TODO EXCEPTIONS: better exception handling
            perms.setPending(false);
            userMgr.savePermissions(perms);
            RollerFactory.getRoller().flush();

            ActionMessages msgs = new ActionMessages();
            msgs.add(null, new ActionMessage(
                    "yourWebsites.accepted", perms.getWebsite().getHandle()));
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.