Skip to content

Clean up ACL checking#10755

Merged
wilsonge merged 2 commits intojoomla:stagingfrom
roland-d:fix-acl-superusers
Jun 8, 2016
Merged

Clean up ACL checking#10755
wilsonge merged 2 commits intojoomla:stagingfrom
roland-d:fix-acl-superusers

Conversation

@roland-d
Copy link
Copy Markdown
Contributor

@roland-d roland-d commented Jun 8, 2016

Summary of Changes

This change fixes the reporting of the ACL settings.

Testing Instructions

  1. Go to System -> Global configuration -> Permission
  2. Click on Super User
  3. You will see that the permissions will show allowed/not allowed instead of Allowed (Super User)
  4. Click on Administrator
  5. You will see that the permissions will show as Allowed (Super User) / Not allowed even if a permission is set to Allowed.
  6. Apply the patch
  7. Go to System -> Global configuration -> Permission
  8. Click on Super User
  9. You will see that the permissions will now show Allowed (Super User) for all of them
  10. Click on Administrator
  11. You will see that the permissions will now show as Allowed / Not allowed / Conflict (depends on your settings)
  12. Please also check the other ACL settings you have in use to make sure all reported statuses are correct.

Calling @andrepereiradasilva and @infograf768 for special attention :)

@roland-d roland-d added this to the Joomla 3.6.0 milestone Jun 8, 2016
@infograf768
Copy link
Copy Markdown
Member

Corrects a lot of stuff. Still some Ajax issues I guess.
Test on staging:

before, for superUser
screen shot 2016-06-08 at 09 07 54

Before, for administrator
screen shot 2016-06-08 at 09 08 06

After, for superuser
screen shot 2016-06-08 at 09 06 29

After for administrator
screen shot 2016-06-08 at 09 13 03

BUT, if I change a permission to Denied for superUser , before save I get

screen shot 2016-06-08 at 09 16 18

and after save

screen shot 2016-06-08 at 09 03 56

So, this is a small problem, but it also shows (and I have seen that all over before or after patch), that we have to save the permissions to get the correct saved settings.
Ajax does not do its job OK.
Alas, a PR took off the instruction to Save the permissions in lang strings:
See #10115

@infograf768 infograf768 mentioned this pull request Jun 8, 2016
@roland-d
Copy link
Copy Markdown
Contributor Author

roland-d commented Jun 8, 2016

@infograf768 The AJAX results after saving are not part of this PR, I am going to make a separate one for that.

As for the Denied, if I am not mistaken, this is always overriden by the Super User setting or not?

@infograf768
Copy link
Copy Markdown
Member

As for the Denied, if I am not mistaken, this is always overriden by the Super User setting or not?

The calculated settings after saving are correct. I will test now site login (for example) after and before save.

@infograf768
Copy link
Copy Markdown
Member

@roland-d

yep, the display of the permissions is wrong but the super user can login in frontend before and after saving the permissions.

@roland-d
Copy link
Copy Markdown
Contributor Author

roland-d commented Jun 8, 2016

@infograf768 I have not looked at the AJAX results yet, that will be the next PR :)

Perpahs we should show the Conflict status if you set this to Denied but it is overruled.

@infograf768
Copy link
Copy Markdown
Member

Perpahs we should show the Conflict status if you set this to Denied but it is overruled.

Well, if the Ajax issue is solved, it should not stay at all in the New settings box, should'nt it?
Or should it until Save? If yes, adding the Conflict status looks like the only solution before Save.

@roland-d
Copy link
Copy Markdown
Contributor Author

roland-d commented Jun 8, 2016

@infograf768 Even with AJAX, we can't change the dropdown back to what it was as it will appear as nothing worked. We can then show the Conflict status and perhaps a message that the change wasn't saved because of it.


// The calculated setting is not shown for the root group of global configuration.
$canCalculateSettings = ($group->parent_id || !empty($component));
$canCalculateSettings = ($group->parent_id || '' !== $component);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing the empty check over this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not removing the empty check, we are still checking if it is empty. Since $component is a string you only need to check against an empty string. No need to use empty.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://maettig.com/code/php/php-performance-benchmarks.php empty used to have a performance benifit. Not sure if it's still the case in modern php versions. But imho is easier to read....

@infograf768
Copy link
Copy Markdown
Member

@roland-d

Will this be still updated or can I mark the test as succesful? It is quite urgent to get it in.


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

@roland-d
Copy link
Copy Markdown
Contributor Author

roland-d commented Jun 8, 2016

@infograf768 This PR is ready to go, I am working on the AJAX code now.

@infograf768
Copy link
Copy Markdown
Member

I have tested this item ✅ successfully on 93b27b9

OK here. One more tester.


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

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

andrepereiradasilva commented Jun 8, 2016

if super user cannot be changed can't we disable the select boxes for the super user group?
Or return a js message saying that cannot be changed?

Update: Froget it i saw your other PR now.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 93b27b9

works as described. thanks.


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

@roland-d
Copy link
Copy Markdown
Contributor Author

roland-d commented Jun 8, 2016

@andrepereiradasilva Thanks for the test. I was actually thinking, on the Super User tab, you only need the Super User privilege. The rest is useless basically. Indeed, this would be for another PR.

@roland-d
Copy link
Copy Markdown
Contributor Author

roland-d commented Jun 8, 2016

RTC as we have 2 succesful tests


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 8, 2016
@wilsonge wilsonge merged commit 7ba3598 into joomla:staging Jun 8, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 8, 2016
@roland-d roland-d deleted the fix-acl-superusers branch January 29, 2017 19:47
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.

5 participants