Object Auth. Now object can be included with "include OrbitCoreLib::ObjectAuthable" to use kernel method,such as

1.Object.authed_for_user(user,title_of_object_auth).  title_of_object_auth is optional
2.object.authed_users(user,title_of_object_auth) .  title_of_object_auth is optional
if title_of_object_auth is not given,then it will return calculation across all possiblity.
This commit is contained in:
Matthew Kaito Juyuan Fu committed 2012-02-09 17:48:51 +08:00
1 parent 3a8dbd6af4
commit 31d7cd5b38
7 files changed
+96 -52

No files matched your search

+2 -1
View File
@@ -1,9 +1,10 @@
class Post
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCoreLib::ObjectAuthable
field :title, :type => String
field :body, :type => String
embeds_many :comments
validates_presence_of :title, :body
has_one :object_auth,as: :obj_authable,dependent: :delete
end