Security: Class method disallows but the create link is still displayed on top of list
9 views
Skip to first unread message
Schlinge
unread,
Sep 11, 2012, 8:06:57 AM9/11/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to actives...@googlegroups.com
I am using AS Security methods to restrict actions for users that are not authorized. I implemented this class method in my model: class MyModel < ActiveRecord::Base # ... protected def self.authorized_for_create? false end end
Although MyModel is acting like expected in the rails console:
The create link on top of the list is still being rendered (which is not what i expected). When i click it, a 401 Unauthorized Error is logged in the server output.
Is it a bug or do i miss something out? Any ideas? Anybody?