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

Prevent create categories in first level if user is not allowed #8083

Closed
wants to merge 6 commits into from
Closed

Prevent create categories in first level if user is not allowed #8083

wants to merge 6 commits into from

Conversation

n9iels
Copy link
Contributor

@n9iels n9iels commented Oct 13, 2015

This PR will fix a part of the issues described in #8069

The issue

A user with ACL right to create, delete, edit, edit State, edit own in a specified category can also create new categories on the first level. (no parent)

How to test

  1. Create a usergroup with registered as parent
  2. Select that group in the "Special" view/access level
  3. In Global configuration, allow Administrator Login for this group
  4. In the Global options of Articles, Categories and Featured Articles set "Access Administrator interface" to Allowd for that group
  5. Create a new category and set the permissions of hat categories for the new user group for the following item on allowed:
    • Create
    • Delete
    • Edit
    • Edit state
    • Edit Own
  6. Create a new user for the created user group
  7. Login with the user on the back-end
  8. Click on the create button and notice you can create a category for "no parent"
  9. Apply patch, and notice you can't create categories for "no parent" any more

Note

Can someone please review if this is a good solution? I know it solves the issue, but I don't know exactly why that piece of code was placed

@zero-24
Copy link
Member

zero-24 commented Oct 13, 2015

@n9iels that code was added here by @sanderpotjer see #3401


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@n9iels
Copy link
Contributor Author

n9iels commented Oct 13, 2015

@zero-24 thanks, I couldn't find that.

Difficult situation, the solution of #3401 cause this one.
So we have to find a solution that makes sure that:

  • Level 0 will not unset if the the parameter "Create" is set on allowed in: Article -> Permissions
  • Level 0 will unset in other situations (assuming that creating categories on level 0 is only allowed when you have full create access)

@Webdongle
Copy link
Contributor

I have tested this item ✅ successfully on 4f50046

Works as expected ... Prevents users creating Categories outside of the hierarchy of the Category they have Edit Permission for


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@n9iels
Copy link
Contributor Author

n9iels commented Oct 13, 2015

@Webdongle Thanks for testing! But it seems like the solution for this issue is not ready yet. Please test again when we have good solution :)

@Webdongle
Copy link
Contributor

OK ... as soon as I get the email will test it

@coolcat-creations
Copy link
Contributor

I can´t access anything to create content (before applying the patch)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@roland-d
Copy link
Contributor

Hello @n9iels

Thank you for your contribution.

The last comment here was on 24th October 2015. So the question is, Is this issue/pull request still valid?
If no reply is received within 4 weeks we will close this issue.

Thanks for understanding!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@roland-d
Copy link
Contributor

roland-d commented May 7, 2016

No need for PLT to decide here yet. I have contacted Niels and asked him to update this issue. Let's wait a bit longer before closing this.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @Webdongle


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @Webdongle


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @Webdongle


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @Webdongle


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8083.

@n9iels
Copy link
Contributor Author

n9iels commented May 7, 2016

Ignore the commit, there is on this moment no solution for this problem. Because the - no parent - (level 0) has no access right. So $user->authorise() can't determine if the current has is allowed to edit this level.

I close this PR now.

@n9iels n9iels closed this May 7, 2016
@n9iels n9iels deleted the com-categories-acl branch May 7, 2016 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants