Commit eb437d98 by Dan Krause

Set an ACL on ParseResource by default

Also switch ACLs default permissions to public read/write

fixes #97
parent 4773ed7a
...@@ -255,6 +255,8 @@ class ACL(ParseType): ...@@ -255,6 +255,8 @@ class ACL(ParseType):
def __init__(self, acl=None): def __init__(self, acl=None):
self._acl = acl or {} self._acl = acl or {}
if acl is None:
self.set_default(read=True, write=True)
def _to_native(self): def _to_native(self):
return self._acl return self._acl
...@@ -317,6 +319,8 @@ class ParseResource(ParseBase): ...@@ -317,6 +319,8 @@ class ParseResource(ParseBase):
def __init__(self, **kw): def __init__(self, **kw):
self.objectId = None self.objectId = None
self._init_attrs(kw) self._init_attrs(kw)
if 'ACL' not in kw:
self.ACL = ACL()
def __getattr__(self, attr): def __getattr__(self, attr):
# if object is not loaded and attribute is missing, try to load it # if object is not loaded and attribute is missing, try to load it
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment