Needs work
Project:
Entity Claim
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2016 at 20:28 UTC
Updated:
4 Feb 2017 at 15:29 UTC
Jump to comment: Most recent
Claim access always returns false for anonymous user regardless of permissions.
| Comment | File | Size | Author |
|---|---|---|---|
| entity-claim-link-anonymous-users-false-2642996-1.patch | 1.04 KB | monstrfolk |
Comments
Comment #2
nikunjkotechaI think this works as designed, we don't want anonymous users to claim anything, they need to register/login.
Comment #3
monstrfolk commentedHow does the login link get shown to an anonymous user? It never will. If the user does not have a uid then access is always false.
Comment #4
nikunjkotechaSeems like the recent changes we made to conditions stopped that, I'll check it thoroughly and ensure it works as before.
There were two things - one: User has access to claim, two: claim is allowed on the entity.
If claim is allowed but user is anonymous, we display login link, if claim is allowed, user is not anonymous - we check user_access too.
Comment #5
monstrfolk commentedI think access should return true for anonymous users if authenticated users have access to post claims. This way an add claim link will be shown to anonymous users with a link to the login page.
Hope that makes sense.
Comment #6
monstrfolk commentedComment #7
nikunjkotechaYep, makes sense. I'm thinking of reworking this and create two functions, one to check claim allowed and other two check user access and ensure it is not dependent on the conditions that we add later while displaying links and use the permission of anonymous user to display login link instead of displaying it by default. I'll also add the description in permission explaining that if allowed to anonymous, it will display the login link.
Comment #8
monstrfolk commentedok...also, look at the other patch i created.
https://www.drupal.org/node/2801535
the code i have in the block follows that logic...
Comment #9
nikunjkotechaYes, this is in the block. My concern is we are returning TRUE in access check so everywhere we do just access check we will need to handle this than.
Comment #10
monstrfolk commentedYeah....I don't see another way to handle it. I think the only places that need to handle this is in the block link and links in the page of the entity. 2 places?
Comment #11
nikunjkotechaIn access callback for the menu item to add form
Comment #12
monstrfolk commentedthat is a problem.
Comment #13
monstrfolk commented@miteshmap, this issue is related to https://www.drupal.org/node/2801535.
Do you think this is a problem?