6
7
8
9
10
11
12
13
14
15
|
# File 'lib/rad/mongo_mapper/acts_as/authorized_object.rb', line 6
def acts_as_authorized_object
key :owner_name, String, :default => lambda{User.current? ? User.current.name : nil}, :protected => true
key :collaborators, Array, :protected => true
key :viewers, Array, :default => lambda{User.current? ? ["user:#{User.current.name}", 'manager'].sort : ['manager']}, :protected => true
validates_presence_of :owner_name
validate :validate_viewers
validate :validate_collaborators
end
|