def test_acl_group_shared(): ann = Annotation(shared=True, userid='saoirse', groupid='lulapalooza') actual = ann.__acl__() expect = [(security.Allow, 'group:lulapalooza', 'read'), (security.Allow, 'saoirse', 'admin'), (security.Allow, 'saoirse', 'update'), (security.Allow, 'saoirse', 'delete'), security.DENY_ALL] assert actual == expect
def test_acl_world_shared(): ann = Annotation(shared=True, userid='saoirse', groupid='__world__') actual = ann.__acl__() expect = [(security.Allow, security.Everyone, 'read'), (security.Allow, 'saoirse', 'admin'), (security.Allow, 'saoirse', 'update'), (security.Allow, 'saoirse', 'delete'), security.DENY_ALL] assert actual == expect
def test_acl_private(): ann = Annotation(shared=False, userid='saoirse') actual = ann.__acl__() expect = [(security.Allow, 'saoirse', 'read'), (security.Allow, 'saoirse', 'admin'), (security.Allow, 'saoirse', 'update'), (security.Allow, 'saoirse', 'delete'), security.DENY_ALL] assert actual == expect