?
avatar sanderpotjer
sanderpotjer
6 Mar 2017

Steps to reproduce the issue

Set the Access for a field to "Guests". In that way a field should not be visible to logged in users (assuming you have the Guest access level correctly configured). Check if field is visible in the frontend, login on the frontend and notice the field is still visible.

Please see the screenshots below. To check if the Guest access level is working correctly I have set the "Login" menu-item to Access Guest too.

Before logging in

guest-before

After logging in

guest-after

Backend settings field

screen shot 2017-03-06 at 11 29 24

Expected result

The field with access set to Guest should not be visible after login.

Actual result

The field with access set to Guest is visible after login.

avatar sanderpotjer sanderpotjer - open - 6 Mar 2017
avatar joomla-cms-bot joomla-cms-bot - change - 6 Mar 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Mar 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Mar 2017

Confirmed. Field is always shown, independend of which Acces-Level is set.

avatar coolcat-creations
coolcat-creations - comment - 6 Mar 2017

The Access Level is working only for the INPUT field i think?

avatar Bakual
Bakual - comment - 6 Mar 2017

Can you please try with a user that isn't allow to manage the fields (actually doesn't have global "core.admin" permission)? Because the ACL check is skipped for those.

avatar sanderpotjer
sanderpotjer - comment - 6 Mar 2017

@Bakual then the field is indeed not displayed if you login. So it indeed seems to be an issue when you have "core.admin" permissions.

avatar Bakual
Bakual - comment - 6 Mar 2017

Good. That doesn't mean the code is correct but it explains the behaviour ?
The code in question is https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_fields/models/fields.php#L230-L235

We need that check because we use the same model in frontend and backend. And we obviously need to be able to see fields with access level "guest" in backend ?
I'm not sure if that could be solved easy somehow. Maybe with an additional check for the application (site vs administrator)?

avatar laoneo
laoneo - comment - 7 Mar 2017

@Bakual guess the easiest solution would be indeed to do an application check.

avatar laoneo
laoneo - comment - 11 Mar 2017

What happens when somebody doesn't have view access but can edit the field, should the field then be visible when editing an article?

avatar Bakual
Bakual - comment - 11 Mar 2017

Try to keep it consistent with other places in the CMS. Eg look what happens if a user isn't set to see an article but could edit it.

avatar laoneo
laoneo - comment - 20 Mar 2017

I made a test and could successfully edit an article I don't have the necessary access level. So when we can agree that in fields it will be the same that the access level is not checked when editing an article then I can do a pr for it. But first I would like to get a confirmation for it. @sanderpotjer what do you think about that?

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Mar 2017
Category ACL com_fields
avatar laoneo
laoneo - comment - 1 Apr 2017

I would like to get that solved, any opinions about the proposal to make it work the same way as with articles?

avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Apr 2017
Status New Needs Review
avatar laoneo
laoneo - comment - 11 Apr 2017

Should we label this one as release blocker?

avatar brianteeman
brianteeman - comment - 11 Apr 2017

Y4s

avatar zero-24 zero-24 - change - 11 Apr 2017
Labels Added: ?
avatar zero-24 zero-24 - labeled - 11 Apr 2017
avatar zero-24
zero-24 - comment - 11 Apr 2017

I made a test and could successfully edit an article I don't have the necessary access level.

What does that exactly mean?

avatar Bakual
Bakual - comment - 11 Apr 2017

@sanderpotjer Can you give your inputs one Allons question?

avatar laoneo
laoneo - comment - 12 Apr 2017

@zero-24 That I logged in as a user which does belong to the Registered user group only. I gave an article edit permission for the Registered groups. On the front, I logged in as that user and started to edit an article. Then I set the access level of that article to special in the back end. On the front where I'm logged in as registered user I hit the F5 button. I'm still able to save the article, despite the fact that I don't have the right access level.

avatar Bakual
Bakual - comment - 12 Apr 2017

Imho F5 on the edit view does bypass some checks since you have the flag already set in the session. A more appropriate test would be to use the original "&task=edit" link on an article you haven't edited yet in that session.

avatar rdeutz
rdeutz - comment - 17 Apr 2017

@laoneo please implement it in the way it is done in other areas so that we can merge it after RC3, don't wait any time longer on Sander

avatar rdeutz rdeutz - change - 17 Apr 2017
Labels Removed: ?
avatar rdeutz rdeutz - unlabeled - 17 Apr 2017
avatar rdeutz
rdeutz - comment - 17 Apr 2017

removed release blocker, because it is not critical, to get the information you just need to log out and get it. The way around would be a bigger problem

avatar Bakual
Bakual - comment - 18 Apr 2017

Closing as we have a PR to test: #15365

avatar Bakual Bakual - change - 18 Apr 2017
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2017-04-18 08:19:02
Closed_By Bakual
avatar Bakual Bakual - close - 18 Apr 2017

Add a Comment

Login with GitHub to post a comment