Problem/Motivation

In a multi-user site, where multiple users can create their own feeds, it is required to give users the ability to manage their own feeds and feed items.

Proposed resolution

Add the following permissions (per feed type):

view own $id feeds
update own $id feeds
delete own $id feeds
delete own $id feed items
import own $id feeds
schedule_import own $id feeds
unlock own $id feeds

Remaining tasks

  • Add the permissions to \Drupal\feeds\FeedsPermissions.
  • Make sure that the permissions get respected (changes required in FeedAccessControlHandler).
  • Add test coverage for each permission (new Functional test)

Original report by alayham

In a multi-user site, where multiple users can create their own feeds, it is required to give users the ability to manage their own feeds and feed items.
I suggest adding the following permissions to feeds:
edit own feeds
delete own feeds
delete own feed items
import own feeds
view own feeds

Issue fork feeds-3136344

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alayham created an issue. See original summary.

megachriz’s picture

Issue tags: +Needs tests

Good suggestion. I didn’t realize these permissions didn’t exist already.

I suggest to add the following as well:

  • Import own feeds in background
  • Unlock own feeds

“Unlock own feeds” would probably be a rare permission to assign, as unlocking is more a site administrator kind of task, but just listed it here for completeness.

Patches are welcome. :)

Having a functional test for this feature would be great.

jrochate’s picture

Hi.

Is there any alternative to limit feeds to it's owner, while this feature is not available?

megachriz’s picture

Issue summary: View changes

An alternative I can think of is creating a separate feed type and a separate role per user that need to create feeds, but that doesn't sound convenient to me. Though if you only have 2 or 3 users that need to create feeds, it could be an acceptable workaround.

I think a feature like this shouldn't be too hard to code, I think it should be doable in one day to make. Therefore I'm adding this issue to #3165018: [meta] Feeds intermediate issues. This way, it could be picked up during sprints. The next global sprint is on January 28-30, so you could try to promote this issue for that.
See https://groups.drupal.org/node/536597.

megachriz’s picture

irinaz made their first commit to this issue’s fork.

DigantDj made their first commit to this issue’s fork.

megachriz’s picture

Code looks good so far, thanks @DigantDj :)

Now just the automated tests. Do you want to handle that as well?

megachriz’s picture

Status: Active » Needs work

@DigantDj
Tests look great! I do see for some cases tests are missing:

  • Delete own feeds
  • Unlock own feeds

I think there needs to be an additional check that an user isn't able to do stuff on a feed from an other feed type that he/she owns. So if an user has the permission "view own [feed type 1] feeds", I think the test should assert that the user cannot view own feeds of feed type 2. So just to cover the case that "$operation own" only applies to one feed type.

megachriz’s picture

By the way, the "Unlock" operation was just added today on the admin listing ;).

digantdj’s picture

Status: Needs work » Needs review

@MegaChriz Thanks for the feedback, the changes have been pushed to the merge request.

kristen pol’s picture

Issue tags: -Needs tests

Tests were added for:

  • Delete own feeds
  • Unlock own feeds

as per #10 so removing tag.

  • MegaChriz committed 8be6b6b on 8.x-3.x authored by DigantDj
    Issue #3136344 by DigantDj, MegaChriz, Kristen Pol: Added permissions...
megachriz’s picture

Status: Needs review » Fixed

Thanks for your work @DigantDj. I made a few small changes (code style fixes, minor corrections in code comments, small addition to unlock test) and merged the result.

digantdj’s picture

The changes look good @MegaChriz.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.