Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to show the "List" capabilities without the Permissions plugin? #536

Open
stevejburge opened this issue Aug 2, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@stevejburge
Copy link
Member

stevejburge commented Aug 2, 2022

Can we allow users to show the "List" capabilities without the Permissions plugin? It would be much simpler for users if just one plugin was required.

Two possible approaches:

  1. We add a new setting that could be "Block users from seeing posts they can not edit". It would be disabled by default.

  2. The "List" area offers both checks and also X, as with all the other areas of the "Capabilities" screen.

@stevejburge stevejburge added the enhancement New feature or request label Aug 2, 2022
@stevejburge stevejburge added this to the 2.5: WooCommerce milestone Aug 2, 2022
@olatechpro
Copy link
Collaborator

@stevejburge Can you make me understand the first and second point clearer?

Based on my understanding, you want users to be able to user "List" capabilities without the Permissions plugin and to do so, it require copying the current implementation from permission plugin to capabilities and probably add a check to see if permission is active but if not active, execute the code which is straight forward.

Now, back to your approach:

We add a new setting that could be "Block users from seeing posts they can not edit". It would be disabled by default.

Automatically, users are block from post they can not edit with or without this settings and list capabilities is not assigned by default which shows they had to be checked to work when edit is not assigned to role. So, are you implying this settings should automatically enable users to see posts they can not edit even without the capability check else, i don't see the reasons for the settings unless what you mean is this settings will determine if list capabilities and it tab will be visible or not

The "List" area offers both checks and also X, as with all the other areas of the "Capabilities" screen.

Currently, the list area offers all but as @agapetry explained in #206 (comment) and in his words:

These capabilities function as a subset of the edit capabilities, meaning they are checked only if the user does not satisfy the corresponding edit requirement (for the purpose of listing posts or pages). If the corresponding edit capability is assigned, revoking or negating the list capability will have no effect.

So, checking 'X' does not have any practical effect on these capabilities and they only matter for listing only when edit is not checked for the role.

So, literally, aside the fact we need to copy permission code to capabilities to implement the list feature, i don't understand both of the listed approaches and how this could help or work and if there's still something i don't understand well, i'll be glad for explanation on it to make me understand the intention better.

@stevejburge
Copy link
Member Author

@olatechpro Thanks for the detailed overview. I missed that comment by @agapetry. It makes my idea in #2 impossible.

When it comes to Permissions, I've talked with @agapetry about this. In my opinion, Permissions does too much when it's first installed. It should not automatically remove the list capability.

So I would like to see feature #1 .... "Block users from seeing posts they can not edit". It would be disabled by default.

@agapetry @olatechpro Would this be better in Capabilities or Permissions?

  • If Capabilities, it makes more logical sense because the "List" controls are there and users won't have to install a 2nd plugin
  • If Permissions, it makes more sense for backwards compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants