? Success
Pull Request for # 11154

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
20 Jul 2016

Pull Request for Issue #11154.

Summary of Changes

Add com_tags core.create ACL check in tags fields.

Testing Instructions

  • Use latest staging
  • Create a user that is not allowed to create tags. "Denied" in create com_tags permissions.
  • Login with that user and try to edit an article and try to add a new tag. You can.
    image

  • Apply patch

  • Repeat the same steps, you CAN'T create tags.
  • Now change the permission to "Allowed" in create com_tags permissions.
  • Repeat the same steps, you CAN create tags.
  • Do a code review

Note: try in the frontend and backend

avatar andrepereiradasilva andrepereiradasilva - open - 20 Jul 2016
avatar andrepereiradasilva andrepereiradasilva - change - 20 Jul 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jul 2016
Labels Added: ?
avatar ggppdk
ggppdk - comment - 20 Jul 2016

Tags core.create

  • is not tags usage / tags assignment

If something is to be patched is to prevent new tag creation, and not tags usage / tags assignment

Then if someone would want to treat core.create privelege the same way that core.create is used to prevent creation of articles inside a category,

  • then you would want to check the core.create on every tag asset but there is no asset for individual tags

To be honest tags feature needs some more work

  • fix frontend / backend forms allowing creation of tags to users without core.create
  • add component level ACL privelege core.assign for assigning tags,
  • optionally add ACL asset to individual tags (this would include at minimum the core.assign) to allow controlling assignments of individual tags If the last one is done, then ajaxifying tags assignment becomes a "must" because you would need to calculate ACL on possible thousands of individual tags, otherwise the form load would be considerable more slow in web-sites with 2,000 or 5,000 or very slow for 20,000+ tags

a much simpler alternative that i would want to suggest is creating 1 more property for tags:
"assign access level" besides the "view access level"

"assign access level" will be used for assigning tags
"view access level" will continue to be used for viewing

The above may seem strange usage of access levels, but would greatly improve calculation of tags allowed to a user to be assigned

  • we don't really need individual assets to tags if we do the above
avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Jul 2016

@ggppdk did you test?

In the frontend new article view (you can create a menu item of new article tipe to go to that form) you have the ability to select/create tags.

But if the user does not have permissions to create tags how can it be allowed to create tags?
The user can still select existing tags.

This PR only solves that
image

Please test

avatar ggppdk
ggppdk - comment - 20 Jul 2016

@andrepereiradasilva

i am sorry, i think miss-read the original issue report, thinking he meant tag assigments and tag creation both

the user is still able to create and send successful completion of the article with the tags added.

and i thought you wanted to prevent tag assignments, my mistake, but i see that the title of the issue is more clear

tested, yes, you are right it works (almost)

  • but there is no server side validation

if someone manipulates the select element then can still create tags , since you would need to also add server side validation (i can still create tags by editing the select element directly) and adding:

    <option value="#new#form_tampered2" selected="selected">form_tampered2</option>

so this PR works but needs 1 more server side check
probably in (or in methods calling it):

JHelperTags::createTagsFromField()
avatar ggppdk
ggppdk - comment - 20 Jul 2016

Maybe the server side check should not be in:

JHelperTags::createTagsFromField()
  • some code maybe passing to tags helper object method non sumbitted data thus that code woud be prevented from working

check should be at the same place where $form->validate() is called ?
libraries\legacy\controller\form.php

anyway someone should say best place for this,
still most easy and quick thing is to put check in:

JHelperTags::createTagsFromField()
avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Jul 2016

ok, so i added server side validation. please test.
also, i don' t know the tags component very well, so please check if everything seems ok.

9132e07 20 Jul 2016 avatar andrepereiradasilva not
avatar ggppdk
ggppdk - comment - 20 Jul 2016

@andrepereiradasilva

Sure will test tomorrow, someone else may test too by then,

also why not update display() of view.html.php for backend form too ?

  • i mean for article form , maybe another PR for all other forms
avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Jul 2016

i mean for article form , maybe another PR for all other forms

if ok, the server side part is done in this PR + the new article form (frontend)

backend forms need to have the same change in another PR IMHO

avatar brianteeman brianteeman - change - 20 Jul 2016
Category ACL Tags
avatar brianteeman brianteeman - change - 20 Jul 2016
Rel_Number 0 11154
Relation Type Pull Request for
avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Jul 2016

actually thinking it better it this is for all tag field there must be a better way to not allow in all field at the same time.
So please don't test until i check that out.

avatar joomla-cms-bot joomla-cms-bot - change - 20 Jul 2016
Category ACL Tags Libraries ACL
avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Jul 2016

ok, @ggppdk acl core.create check should now work in all tag fields

avatar andrepereiradasilva andrepereiradasilva - change - 22 Jul 2016
Title
[frontend new article] Don't allow to create tags if user not allowed
[ACL] Don't allow to create tags if user not allowed
avatar andrepereiradasilva andrepereiradasilva - change - 22 Jul 2016
Title
[ACL] Don't allow to create tags if user not allowed
[ACL] Don't allow to create tags if user is not allowed to do it
avatar andrepereiradasilva andrepereiradasilva - change - 22 Jul 2016
The description was changed
avatar andrepereiradasilva andrepereiradasilva - change - 22 Jul 2016
The description was changed
avatar andrepereiradasilva
andrepereiradasilva - comment - 22 Jul 2016

updated test instructions to be more clear. please test.

avatar andrepereiradasilva andrepereiradasilva - change - 22 Jul 2016
The description was changed
avatar andrepereiradasilva andrepereiradasilva - change - 22 Jul 2016
The description was changed
avatar andrepereiradasilva andrepereiradasilva - change - 22 Jul 2016
The description was changed
avatar andrepereiradasilva
andrepereiradasilva - comment - 27 Jul 2016

no volunteers to test?

avatar ggppdk ggppdk - test_item - 27 Jul 2016 - Tested successfully
avatar ggppdk
ggppdk - comment - 27 Jul 2016

I have tested this item successfully on 724abfe

User without ACL "create" on tags component, cannot create new tags in the article form

  • form tampering to inject tag directly is (correctly) ignored during save:
<option value="#new#terrest" selected="selected">terrest</option>

User with ACL "create" on tags component, can create tags in the article form


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

avatar truptikagathara truptikagathara - test_item - 28 Jul 2016 - Tested successfully
avatar truptikagathara
truptikagathara - comment - 28 Jul 2016

I have tested this item successfully on 724abfe


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

avatar zero-24 zero-24 - change - 28 Jul 2016
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 28 Jul 2016

RTC based on testing. Thanks


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

avatar joomla-cms-bot joomla-cms-bot - change - 28 Jul 2016
Labels Added: ?
avatar wilsonge wilsonge - change - 30 Jul 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-07-30 13:35:09
Closed_By wilsonge
avatar wilsonge wilsonge - close - 30 Jul 2016
avatar wilsonge wilsonge - merge - 30 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - close - 30 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - change - 30 Jul 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment