Groups
Groups
Sign in
Groups
Groups
Rails Authorization Plugin
Conversations
About
Send feedback
Help
permit "superadmin or administrator of "
15 views
Skip to first unread message
Erwin
unread,
Jul 3, 2009, 6:23:28 PM
7/3/09
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 Rails Authorization Plugin
I have a Controller with a before_filter to find the parent
LibrariesController
before_filter :find_academy
..
private
# Find academy params[:academy_id]
def find_academy
@academy = Academy.find(params[:academy_id]) unless params
[:academy_id].nil?
rescue ActiveRecord::RecordNotFound
render_404
end
I would like to authorize ONLY the superadmin and the administrator of
the academy to perform actions
I can write in EACH action
permit "superadmin or administrator of :academy" do
..
end
but is there a way to write it only once ? in a before_filter ?
thanks for your enlightments
erwin
Reply all
Reply to author
Forward
0 new messages