Examples of PermissionsData


Examples of org.apache.roller.pojos.PermissionsData

   
    private PermissionsData getPermissionsData(String handle, String username) throws HandlerException {
        try {
            UserData ud = getUserData(username);
            WebsiteData wd = getWebsiteData(handle);
            PermissionsData pd = getRoller().getUserManager().getPermissions(wd, ud);
           
            return pd;
        } catch (RollerException re) {
            throw new InternalException("ERROR: Could not get permissions data for weblog handle: " + handle + ", user name: " + username, re);
        }
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

   
    private MemberEntrySet updateMembers(MemberEntrySet c) throws HandlerException {
        List permissionsDatas= new ArrayList();
        for (int i = 0; i < c.getEntries().length; i++) {
            MemberEntry entry = (MemberEntry)c.getEntries()[i];
            PermissionsData pd = getPermissionsData(entry);
            if (pd == null) {
                throw new NotFoundException("ERROR: Permissions do not exist for weblog handle: " + entry.getHandle() + ", user name: " + entry.getName());
            }
            updatePermissionsData(pd, entry);
            permissionsDatas.add(pd);
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

        if (username == null) {
            throw new BadRequestException("ERROR: No user name supplied in URI");
        }
       
        try {
            PermissionsData pd = getPermissionsData(handle, username);
            PermissionsData[] pds;
            if (pd == null) {
                throw new NotFoundException("ERROR: Permissions do not exist for weblog handle: " + handle + ", user name: " + username);
            }
            pds = new PermissionsData[] { pd };
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

            throw new NullPointerException("ERROR: Null permission data not allowed");
        }
       
        List entries = new ArrayList();
        for (int i = 0; i < pds.length; i++) {
            PermissionsData pd = pds[i];
            Entry entry = toMemberEntry(pd);
            entries.add(entry);
        }
        MemberEntrySet mes = new MemberEntrySet(getUrlPrefix());
        mes.setEntries((Entry[])entries.toArray(new Entry[0]));
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

            HttpServletResponse response)
            throws Exception {
       
        YourWebsitesForm form = (YourWebsitesForm)actionForm;       
        UserManager userMgr = RollerFactory.getRoller().getUserManager();
        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()));
            saveMessages(request, msgs);
        } else {
            ActionErrors errs = new ActionErrors();
            errs.add(null, new ActionError("yourWebsites.permNotFound"));
            saveMessages(request, errs);           
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

            HttpServletResponse response)
            throws Exception {

        YourWebsitesForm form = (YourWebsitesForm)actionForm;       
        UserManager userMgr = RollerFactory.getRoller().getUserManager();
        PermissionsData perms = userMgr.getPermissions(form.getInviteId());
        if (perms != null) {
            // TODO ROLLER_2.0: notify inviter that invitee has declined invitation
            // TODO EXCEPTIONS: better exception handling here
            userMgr.removePermissions(perms);
            RollerFactory.getRoller().flush();

            ActionMessages msgs = new ActionMessages();
            msgs.add(null, new ActionMessage(
                    "yourWebsites.declined", perms.getWebsite().getHandle()));
            saveMessages(request, msgs);
        } else {
            ActionErrors errs = new ActionErrors();
            errs.add(null, new ActionError("yourWebsites.permNotFound"));
            saveMessages(request, errs)
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

        UserData user = rses.getAuthenticatedUser();
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        WebsiteData website = rreq.getWebsite();
       
        UserManager userMgr = RollerFactory.getRoller().getUserManager();
        PermissionsData perms = userMgr.getPermissions(website, user);
       
        if (perms != null) {
            // TODO ROLLER_2.0: notify website members that user has resigned
            // TODO EXCEPTIONS: better exception handling
            userMgr.removePermissions(perms);
            RollerFactory.getRoller().flush();
        }
       
        ActionMessages msgs = new ActionMessages();
        msgs.add(null, new ActionMessage(
                "yourWebsites.resigned", perms.getWebsite().getHandle()));
        saveMessages(request, msgs);
       
        request.setAttribute("model",
                new YourWebsitesPageModel(request, response, mapping));
        ActionForward forward = mapping.findForward("yourWebsites.page");
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

            throws Exception {
       
        InvitationsForm invitationForm = (InvitationsForm)actionForm;
        Roller roller = RollerFactory.getRoller();
        UserManager umgr = roller.getUserManager();
        PermissionsData perms = umgr.getPermissions(invitationForm.getPermissionId());
        ActionErrors errors = new ActionErrors();
        if (perms == null) {
            errors.add(null, new ActionError("invitations.error.notFound"));
            saveErrors(request, errors);
            return view(mapping, actionForm, request, response);
        }
        RollerSession rses = RollerSession.getRollerSession(request);
        if (rses.isUserAuthorizedToAdmin(perms.getWebsite())) {
            umgr.removePermissions(perms);
            roller.flush();
            try {
                notifyInvitee(request, perms.getWebsite(), perms.getUser());
            } catch (RollerException e) {
                errors.add(ActionErrors.GLOBAL_ERROR,
                        new ActionError("error.untranslated", e.getMessage()));
            }
            ActionMessages msgs = new ActionMessages();
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

            HttpServletResponse response)
            throws Exception {

        YourWebsitesForm form = (YourWebsitesForm)actionForm;       
        UserManager userMgr = RollerFactory.getRoller().getUserManager();
        PermissionsData perms = userMgr.getPermissions(form.getInviteId());
        if (perms != null) {
            // TODO ROLLER_2.0: notify inviter that invitee has declined invitation
            // TODO EXCEPTIONS: better exception handling here
            userMgr.removePermissions(perms);
            RollerFactory.getRoller().flush();

            ActionMessages msgs = new ActionMessages();
            msgs.add(null, new ActionMessage(
                    "yourWebsites.declined", perms.getWebsite().getHandle()));
            saveMessages(request, msgs);
        } else {
            ActionErrors errs = new ActionErrors();
            errs.add(null, new ActionError("yourWebsites.permNotFound"));
            saveMessages(request, errs)
View Full Code Here

Examples of org.apache.roller.pojos.PermissionsData

        UserData user = rses.getAuthenticatedUser();
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        WebsiteData website = rreq.getWebsite();
       
        UserManager userMgr = RollerFactory.getRoller().getUserManager();
        PermissionsData perms = userMgr.getPermissions(website, user);
       
        if (perms != null) {
            // TODO ROLLER_2.0: notify website members that user has resigned
            // TODO EXCEPTIONS: better exception handling
            userMgr.removePermissions(perms);
            RollerFactory.getRoller().flush();
        }
       
        ActionMessages msgs = new ActionMessages();
        msgs.add(null, new ActionMessage(
                "yourWebsites.resigned", perms.getWebsite().getHandle()));
        saveMessages(request, msgs);
       
        request.setAttribute("model",
                new YourWebsitesPageModel(request, response, mapping));
        ActionForward forward = mapping.findForward("yourWebsites.page");
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.