class Parse::ACL

Constants

NONE
PUBLIC
PUBLIC_NONE
PUBLIC_READ_ONLY
PUBLIC_READ_WRITE
PUBLIC_WRITE_ONLY
READ_ONLY
READ_WRITE
WRITE_ONLY

Public Class Methods

new(hash={}) click to toggle source
# File lib/parse/acl.rb, line 10
def initialize hash={}, &block
  @acl = hash.dup
  tap &block if block
end

Public Instance Methods

readable(user) click to toggle source
# File lib/parse/acl.rb, line 15
def readable user
  (@acl[user] ||= {})['read'] = true
end
readable?(user) click to toggle source
# File lib/parse/acl.rb, line 19
def readable? user
  !!(@acl[user] ||= {})['read']
end
to_json(*args) click to toggle source
# File lib/parse/acl.rb, line 31
def to_json *args
  @acl.to_json
end
writable(user) click to toggle source
# File lib/parse/acl.rb, line 23
def writable user
  (@acl[user] ||= {})['write'] = true
end
writable?(user) click to toggle source
# File lib/parse/acl.rb, line 27
def writable? user
  !!(@acl[user] ||= {})['write']
end