?
Referenced as Pull Request for: # 11248
avatar bembelimen
bembelimen
16 Jul 2016

The new feature implemented here is heavily broken: #8623

There are several issues:

  1. There is no ACL check (see from @brianteeman: #8623 (comment) and from @ggppdk: #8623 (comment))
    • Create a new user with "manager" rights
    • Remove the "Create" permission for managers in com_content
    • => User can still create "categories on the fly"
  2. If you cannot create new categories in the way described above, you run into the next bug: @ggppdk mentioned, that the article was assigned to the "ROOT" category. The reason is very easy:
  3. Ofc this works with every category which has the same ID as the article...There is also a special case: the category title with the same ID as the articleID will be updated to the name of the "new category" we wanted to create
  4. The category selection breaks on several combinations
    • if there is no category yet, you cannot create one
    • ...

Solutions:
1. Add proper ACL checks(!!!)
2. Add proper cleaning of request variables (ignore_request e.g.)
3. Add proper validation of request variables
4. Fix bug in select dropdown

@pe7er @wilsonge

avatar bembelimen bembelimen - open - 16 Jul 2016
avatar ggppdk
ggppdk - comment - 17 Jul 2016

I replied twice about proper ACL check missing, and then i got no response

  • then i saw it getting merged

But i understand now that sometimes, people are busy, to read all the comments , especially when something is marked already RTC

  • my fault, that i did not do the proper thing, i should have posted a test-fail response , to alert people to read my comment
avatar ggppdk
ggppdk - comment - 17 Jul 2016

I see what happend now, i had replied to a PR that closed / merged already !, no wonder that most people just passed it without reading my comment

avatar brianteeman brianteeman - change - 17 Jul 2016
Category ACL Administration
avatar izharaazmi
izharaazmi - comment - 18 Jul 2016

IMO, we should consider for once reusing the categories view itself in a iframe modal to choose or create categories. The button can be added to the input field to trigger the modal.

Like this:
image
or this:
image
This way the ACL, parent category etc will be handled by com_categories implicitly. However, I understand that what I am saying is not same as on-the-fly.

If this is acceptable, I can submit a PR myself.

avatar michael-wdd
michael-wdd - comment - 20 Jul 2016

On a very plain install of J3.6 this does not work

When saving the new category is not created and the item is assigned to category "ROOT".

avatar brianteeman brianteeman - change - 21 Jul 2016
Labels Added: ?
avatar JoshuaLewis
JoshuaLewis - comment - 21 Jul 2016

@izharaazmi I love the idea, however it won't feel as on the fly. So instead I suggest having the current method but having a ACL button appear below when a new category is added so that those who want to configure the ACL can do so while not slowing down those who are content with the current setup.

avatar bembelimen
bembelimen - comment - 21 Jul 2016

So instead I suggest having the current method but having a ACL button appear below when a new category is added

Again: the problem is NOT, that there is no ACL for the new category, the problem is, that the new function is broken and ignores the global category ACL...a Privilege Escalation Vulnerability

avatar izharaazmi
izharaazmi - comment - 21 Jul 2016

If some of us thinks it would be acceptable to have little less than "on
the fly" then I'd do the PR with my 2nd approach above. Opinions please!

avatar JoshuaLewis
JoshuaLewis - comment - 21 Jul 2016

@izharaazmi I would support the idea. However I do wonder about the "Refresh" button, is there a way to avoid adding that?

avatar dgt41
dgt41 - comment - 21 Jul 2016

@JoshuaLewis @izharaazmi yup listen for change event on the select and do a re-initialization, something like: #11040

avatar izharaazmi
izharaazmi - comment - 22 Jul 2016

@dgt41 As in #11040 we have a "position" dropdown to listen to, and act on the "other modules" dropdown refresh thing.
Here I don't see such a thing that we can listen to. [New] opens a modal to "category.add" page, that after save doesn't communicate so to the actual page (better if it did), hence the user must do some trigger to fetch the updated list of categories.
How do you suggest this to go around?

avatar bertmert
bertmert - comment - 22 Jul 2016

I prefer the PR of @izharaazmi instead of creating a new category "on the fly" because it would also solve annoying issues like this one #11224

avatar dgt41
dgt41 - comment - 22 Jul 2016

@izharaazmi it's not a one to one exact solution but the modal close could trigger the event (or a hidden button) and then the same ajax call as the other PR will refresh the select element. I just shared that as the second part could be used (with the appropriate changes) here as well

avatar wilsonge
wilsonge - comment - 22 Jul 2016

#11244

Right this is the fix for the ACL Only - the most important part from a security perspective. Please test all the components. All the rest will need to be covered in separate PR's

avatar izharaazmi
izharaazmi - comment - 22 Jul 2016

In fact I took the idea from

image

And yes it has to be an ajax call anyway to fetch the updated list of categories. We just need to find the appropriate trigger for the call. IMO, modal close is okay but not the best one. And I think user should also have the choice to manually trigger the refresh.

avatar dgt41
dgt41 - comment - 22 Jul 2016

@izharaazmi you can also check the way modules update the infos in the menu edit page (but please lets use ajax here, as that one is way too messy javascript code)
screen shot 2016-07-22 at 13 00 16

avatar izharaazmi
izharaazmi - comment - 22 Jul 2016

Okay. Now I'll work on this this weekend. Hope a PR on or around Monday. ?

avatar brianteeman
brianteeman - comment - 22 Jul 2016

Closing as we have #11244 and #11238 that address all three issues


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

avatar brianteeman brianteeman - change - 22 Jul 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-07-22 18:00:27
Closed_By brianteeman
avatar brianteeman brianteeman - close - 22 Jul 2016
avatar brianteeman brianteeman - close - 22 Jul 2016
avatar bembelimen
bembelimen - comment - 22 Jul 2016

Hello @brianteeman the 4th point is still unresolved.

avatar brianteeman
brianteeman - comment - 22 Jul 2016

Missed that - reopening
How can you have a scenario without a single category?

avatar brianteeman brianteeman - change - 22 Jul 2016
Status Closed New
Closed_Date 2016-07-22 18:00:27
Closed_By brianteeman
avatar brianteeman brianteeman - reopen - 22 Jul 2016
avatar brianteeman brianteeman - reopen - 22 Jul 2016
avatar bembelimen
bembelimen - comment - 22 Jul 2016

Thanks,
if you have no article, you can delete all categories

avatar brianteeman
brianteeman - comment - 7 Sep 2016

Hi @bembelimen I am closing this.
Point 4 isnt really related to the create categories on the fly feature at all. Its more fundamental than that - the category field is a required field and that is the issue not the categories on the fly feature. If you want to create a new issue to address that one specific scenario by all means do it but its certainly not a high priority to fix.


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

avatar brianteeman brianteeman - change - 7 Sep 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-09-07 08:03:53
Closed_By brianteeman
avatar brianteeman brianteeman - close - 7 Sep 2016

Add a Comment

Login with GitHub to post a comment