Package org.apache.roller.weblogger.business

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


                        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];
                WeblogPermission pd = toPermissionsData(entry);
                mgr.savePermissions(pd);
                getRoller().flush();
                CacheManager.invalidate(pd.getUser());
                CacheManager.invalidate(pd.getWebsite());
                permissionsDatas.add(pd);
            }
View Full Code Here

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

            WeblogPermission perms = userMgr.getPermissions(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);
                WebloggerFactory.getWeblogger().flush();

                addMessage("yourWebsites.accepted", perms.getWebsite().getHandle());
            } else {
                addError("yourWebsites.permNotFound");
View Full Code Here

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

        assertNotNull(perm);
        assertEquals(WeblogPermission.ADMIN, perm.getPermissionMask());
       
        // update permissions
        perm.setPermissionMask(WeblogPermission.LIMITED);
        mgr.savePermissions(perm);
        TestUtils.endSession(true);

        // check that update was successful
        testWeblog = TestUtils.getManagedWebsite(testWeblog);
        testUser = TestUtils.getManagedUser(testUser);
View Full Code Here

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

        // accept invitation
        testWeblog = TestUtils.getManagedWebsite(testWeblog);
        user = TestUtils.getManagedUser(user);
        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

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.