If I setup a view that only allows authenticated users to access, pre-authorised users can unexpectedly access the view as well. This is of course a bug. I can reproduce it on two of my setups.
If I setup a view that only allows authenticated users to access, pre-authorised users can unexpectedly access the view as well. This is of course a bug. I can reproduce it on two of my setups.
Comments
Comment #1
hunmonk commentedplease disable all contrib modules, check your permissions, and then perform some tests to see if pre-auth users can access any core-permissioned areas that they should not be able to. for example, if auth users have access to comments, and pre-auth users don't, is this working correctly?
if this is working correctly, then enable views again (and only views, no other contribs), and see if your permission problem still persists. if it does not, then turn on your other contribs one at a time until you find the one causing the problem.
please report back with your findings.
Comment #2
mun commentedHi,
I've disabled all contrib modules and the problem persists. It seems to only clash with Views and not core-permissioned areas.
Thanks
Comment #3
hunmonk commentedwhat views modules are you running? just views API and views UI?
Comment #4
mun commentedYes that's right. It's version 6.x-2.6.
Comment #5
mun commentedWhen I check the roles of a pre-authorised user, there are two roles: authenticated which is checked by greyed out, and pre-authorised, which is checked. Should authenticated be checked but greyed out?
Comment #6
mun commentedI've just had a quick look at views.module and it appears that it assumes all users with an uid are authenticated:
So if I setup a view that only authenticated users can access, pre-auth users will be able to access it too.
Comment #7
hunmonk commentedbecause core doesn't manage the auth user role via the database anymore, logintoboggan must dynamically unassign the authenticated user role when a page is loaded. any module that is manually messing w/ roles is going to screw that up.
i don't think views should be adding in auth/anon to the roles array -- i global $user object should already contain those as added by core where appropriate, at which time logintoboggan can remove the auth role where necessary in the page init.
reassigning.
Comment #8
merlinofchaos commentedIf login toboggan is re-defining what authorized user means, then it has to deal with this. Views just goes by what core does.
I would recommend in this instance not using 'authenticated user', or login toboggan implementing an alternate role filter since it's redefined the roles. Or using a permission string. There are many ways to deal with this.
Comment #9
hunmonk commentedexamining sess_read() and user_load(), both core functions take care of handling anon/auth user roles. IMO it's views bug that it's doing it manually -- it shouldn't be overriding what core does there, because core is already handling it correctly.
looks like a one-line patch to views would fix the issue -- i nominate mun to do it since he wants it fixed... ;)
Comment #10
dawehnerIs this the check to find out whether a account is really active?
Comment #11
esmerel commentedGiven the back and forth on this issue, I'm going to leave it another week, but if it's still inactive then I'm going to close it.
Comment #12
esmerel commented