daociyiyou
unread,Aug 17, 2009, 9:54:26 AM8/17/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
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
hi
I am using the rails_authorization_plugin,but i have a question to
ask.After configure the plugin,i have relations among the
User,Role,RolesUser models,but i notice the relations declaration only
appear in the Role and RolesUser model,not in the User model.Do i
need to declare the relations in User model to make plugin work
properly?
##########
class Role < ActiveRecord::Base
has_many :roles_users, :dependent => :delete_all
has_many :users, :through => :roles_users
belongs_to :authorizable, :polymorphic => true
acts_as_authorizable
end
#######################
class RolesUser < ActiveRecord::Base
belongs_to :user
belongs_to :role
# Authorization plugin
acts_as_authorizable
end