Example #1
0
def registerAclManageOwnPost():
    rightManageOwnPost().addActions(menuAction(), subMenuAction(), modulesAction(), modulesEditAction(), \
                                dashboardAction())\
    .allGet(IBlogService, filter=filterCollaboratorBlog())

    rightManageOwnPost().byName(IBlogPostService, IBlogPostService.delete)
    # TODO: add: filter=filterOwnPost(), also the override crates problems, this should have been on IPostService
    rightManageOwnPost().byName(IBlogPostService, IBlogPostService.insert, IBlogPostService.update,
                                filter=filterCollaboratorBlog())
    rightManageOwnPost().byName(IBlogPostService, IBlogPostService.publish, IBlogPostService.insertAndPublish, IBlogPostService.unpublish, IBlogPostService.reorder,
                                filter=filterAdminBlog())
    rightManageOwnPost().byName(IBlogCollaboratorService, IBlogCollaboratorService.addCollaborator, IBlogCollaboratorService.addCollaboratorAsDefault,
                                filter=filterAdminBlog())
    rightManageOwnPost().byName(IBlogPostService, IBlogPostService.update)  # TODO: add: filter=filterOwnPost()
Example #2
0
def updateCollaboratorSpecification():
    spec = collaboratorSpecification()
    assert isinstance(spec, CollaboratorSpecification)

    spec.type_filter = []
    spec.type_filter.append(('Administrator', filterAdminBlog()))
    spec.type_filter.append(('Collaborator', filterCollaboratorBlog()))

    spec.type_actions = {}
    spec.type_actions['Collaborator'] = [
        menuAction(),
        subMenuAction(),
        modulesAction(),
        modulesArchiveAction(),
        dashboardAction(),
        modulesEditAction()
    ]
    spec.type_actions['Administrator'] = [
        menuAction(),
        subMenuAction(),
        modulesAction(),
        modulesBlogEditAction(),
        modulesEditAction(),
        dashboardAction(),
        modulesAddAction(),
        modulesConfigureAction(),
        modulesManageCollaboratorsAction(),
        modulesManageFeedsAction(),
        modulesBlogPublishAction(),
        modulesBlogPostPublishAction()
    ]
Example #3
0
def registerAclManageOwnPost():
    r = rightManageOwnPost()
    r.addActions(menuAction(), subMenuAction(), modulesAction(),
                 modulesEditAction(), dashboardAction())
    r.allGet(IBlogService, filter=filterCollaboratorBlog())
    r.allGet(ISourceService)
    r.add(ref(IBlogPostService).delete, filter=filterClosedBlog())
    # TODO: add: filter=filterOwnPost(), also the override crates problems, this should have been on IPostService
    r.add(ref(IBlogPostService).insert,
          ref(IBlogPostService).update,
          filter=filterCollaboratorBlog())
    r.add(ref(IBlogPostService).publish,
          ref(IBlogPostService).insertAndPublish,
          ref(IBlogPostService).unpublish,
          ref(IBlogPostService).reorder,
          ref(IBlogCollaboratorService).addCollaborator,
          ref(IBlogCollaboratorService).addCollaboratorAsDefault,
          filter=filterAdminBlog())
    r.add(ref(IBlogPostService).insert,
          ref(IBlogPostService).update,
          ref(IBlogPostService).publish,
          ref(IBlogPostService).insertAndPublish,
          ref(IBlogPostService).unpublish,
          ref(IBlogPostService).reorder,
          filter=filterClosedBlog())
    r.add(ref(IBlogPostService).update)  # TODO: add: filter=filterOwnPost()
Example #4
0
def registerAclManageOwnPost():
    r = rightManageOwnPost()
    r.addActions(menuAction(), subMenuAction(), modulesAction(), modulesEditAction(), dashboardAction())
    r.allGet(IBlogService, filter=filterCollaboratorBlog())
    r.allGet(ISourceService)
    r.add(ref(IBlogPostService).delete)
    # TODO: add: filter=filterOwnPost(), also the override crates problems, this should have been on IPostService
    r.add(ref(IBlogPostService).insert, ref(IBlogPostService).update, filter=filterCollaboratorBlog())
    r.add(ref(IBlogPostService).publish, ref(IBlogPostService).insertAndPublish, ref(IBlogPostService).unpublish,
          ref(IBlogPostService).reorder, ref(IBlogCollaboratorService).addCollaborator,
          ref(IBlogCollaboratorService).addCollaboratorAsDefault, filter=filterAdminBlog())
    r.add(ref(IBlogPostService).update)  # TODO: add: filter=filterOwnPost()
Example #5
0
def updateCollaboratorSpecification():
    spec = collaboratorSpecification()
    assert isinstance(spec, CollaboratorSpecification)

    spec.type_filter = []
    spec.type_filter.append(('Administrator', filterAdminBlog()))
    spec.type_filter.append(('Collaborator', filterCollaboratorBlog()))

    spec.type_actions = {}
    spec.type_actions['Collaborator'] = [menuAction(), subMenuAction(), modulesAction(),
                                         modulesArchiveAction(), dashboardAction(), modulesEditAction()]
    spec.type_actions['Administrator'] = [menuAction(), subMenuAction(), modulesAction(),
                                modulesBlogEditAction(), modulesEditAction(), dashboardAction(), modulesAddAction(), modulesConfigureAction(),
                                modulesManageCollaboratorsAction(), modulesManageFeedsAction(), modulesBlogPublishAction(), modulesBlogPostPublishAction()]