Rails CanCan and dynamically generated Abilities -



Rails CanCan and dynamically generated Abilities -

i utilize cancan on top of mongoid based rails 3 application. introduce general models user, role , privilege. authorization scheme shall authorize @ per action base. hence want store action x roles privilege objects.

now when comes ability dsl generate abilities dynamically after_save hook in proivilege model. results in problem in production mode, cause these runtime changes impact server process privilege changes made.

on other hand 1 reevaluate (the users) abilities before_filter in every controller. slowed downwards every request.

just now, undecided how solve problem. thankful every suggestion.

regards felix

cancan uses simple authorization scheme based on role column on user model.

here links: abilities role based authorization

why need dynamically set privileges? unless have compelling reason introducing unnecessary complexity. define roles need right abilities (you can on controller/action basis cancan) , assign roles upon creation/update.

ruby-on-rails cancan

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -