Topic: Creating Administration pages by using before_filters
At present I am doing something like this
class ApplicationController < ActionController::Base
@rbac_user = session[:rbac_user]
#return true if not @rbac_user.nil?
Now what I want to do is create a before_filter so that
if rbac_user.has_role 'Admin' I change the action to be performed to be
admin_<action>. And of coarse that will then mean that actions like edit, which check whether the user owns that object, will have corresponding admin_edit actions that only the admin can use and which do not do the extra checks.
Is this possible? If so how can it be done?
Last edited by alistair (2006-08-14 19:40:26)