kristianmandrup / roles_mongoid

Roles for mongoid using the Roles generic API from roles_generic
MIT License
29 stars 7 forks source link

he following examples In your doc, i can't see any diffrent. #6

Open ZhangHanDong opened 13 years ago

ZhangHanDong commented 13 years ago

The following examples In your doc, i can't see any diffrent.

Example: role_string strategy

class User
  include Mongoid::Document  
  include Roles::Mongoid 

  strategy :one_role
  valid_roles_are :admin, :guest, :user
end 
 
Example: one_role strategy

class User
  include Mongoid::Document  
  include Roles::Mongoid 

  strategy :one_role
  valid_roles_are :admin, :guest, :user
end