Rails cancan gem for not restfull controller -
is possible use cancan load_and_authorize_resource controller different name model?
i mean:
controller name -> entitypropertiescontroller
model name -> property
i don't found way. there work around solution
class entitypropertiescontroller < applicationcontroller before_filter :authenticate_user! def index check_permission end def new check_permission ... end def create check_permission ... end ... protected def check_permission not_found unless (current_user.admin? || current_user.moderator?) end end
Comments
Post a Comment