[LRUG] Clearance: problems with equivalence of #current_user
Tom Armitage
tom at infovore.org
Tue Apr 21 07:14:20 PDT 2015
So I'm working on a project using Clearance for authentication, and Pundit
for authorization/permissions. I'm particularly enjoying working with
Pundit.
However, I'm running into an issue on the front-end that I don't run into
in my tests: whenever I ask if #current_user is include?ed in the list of
users who have permission to do a thing, I inevitably get 'false' back -
even if they're on that list. By contrast, the moment I ask if
current_user.id is in users.map(&:id) - well, that works fine.
So it feels like there's an issue around equivalence, which makes a bit of
sense, but I have no idea why; all the Clearance docs suggest I can just
use current_user as and when.
Any thoughts or advice? I hope that came over as clear enough.
Best,
t.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20150421/42194f4b/attachment-0003.html>
More information about the Chat
mailing list