mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
20 lines
303 B
Ruby
20 lines
303 B
Ruby
class DocumentAuthorizer < ApplicationAuthorizer
|
|
def readable_by?(user)
|
|
[
|
|
resource.user_id == user.id
|
|
].any?
|
|
end
|
|
|
|
def updatable_by?(user)
|
|
[
|
|
resource.user_id == user.id
|
|
].any?
|
|
end
|
|
|
|
def deletable_by?(user)
|
|
[
|
|
resource.user_id == user.id
|
|
].any?
|
|
end
|
|
end
|