|
|
|
@ -34,7 +34,7 @@ class AccessMode(Enum):
|
|
|
|
|
DELETE = 'd' |
|
|
|
|
ACCEES_EDIT = 'r' |
|
|
|
|
|
|
|
|
|
class UserAccess: |
|
|
|
|
class UserGroups: |
|
|
|
|
def __init__(self, a_UserID : str, a_GroupNamesList : [str]): |
|
|
|
|
self.user_id = a_UserID |
|
|
|
|
self.group_names_list = a_GroupNamesList |
|
|
|
@ -49,9 +49,9 @@ def CheckAccessItem(a_AccessItem : str, a_AccessMode : AccessMode):
|
|
|
|
|
return False |
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
# Возвращает возможность доступа пользователю a_UserAccessData в элемент с правами a_AccessValue по режиму доступа a_AccessMode |
|
|
|
|
def CheckAccessString(a_AccessValue : str, a_UserAccessData : UserAccess, a_AccessMode : AccessMode): |
|
|
|
|
if a_UserAccessData.user_id in config.GetRootIDs(): |
|
|
|
|
# Возвращает возможность доступа пользователю a_UserGroups в элемент с правами a_AccessValue по режиму доступа a_AccessMode |
|
|
|
|
def CheckAccessString(a_AccessValue : str, a_UserGroups : UserGroups, a_AccessMode : AccessMode): |
|
|
|
|
if a_UserGroups.user_id in config.GetRootIDs(): |
|
|
|
|
return True |
|
|
|
|
for i in a_AccessValue.split(';'): |
|
|
|
|
d = i.split('=') |
|
|
|
@ -59,105 +59,105 @@ def CheckAccessString(a_AccessValue : str, a_UserAccessData : UserAccess, a_Acce
|
|
|
|
|
continue |
|
|
|
|
name = d[0] |
|
|
|
|
access = d[1] |
|
|
|
|
if name == a_UserAccessData.user_id or name in a_UserAccessData.group_names_list or name == 'other': |
|
|
|
|
if name == a_UserGroups.user_id or name in a_UserGroups.group_names_list or name == 'other': |
|
|
|
|
if CheckAccessItem(access, a_AccessMode): |
|
|
|
|
return True |
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
def Test(): |
|
|
|
|
for am in AccessMode.ADD, AccessMode.DELETE, AccessMode.EDIT, AccessMode.VIEW, AccessMode.ACCEES_EDIT: |
|
|
|
|
assert CheckAccessString('1234=+', UserAccess('1234', []), am) |
|
|
|
|
assert not CheckAccessString('1234=-', UserAccess('1234', []), am) |
|
|
|
|
assert CheckAccessString('1234=+;gr1=+', UserAccess('1234', ['gr1']), am) |
|
|
|
|
assert CheckAccessString('1234=-;gr1=+', UserAccess('1234', ['gr1']), am) |
|
|
|
|
assert not CheckAccessString('1234=+', UserAccess('123', []), am) |
|
|
|
|
assert not CheckAccessString('1234=-', UserAccess('123', []), am) |
|
|
|
|
assert not CheckAccessString('1234=+;gr1=+', UserAccess('123', ['gr']), am) |
|
|
|
|
assert not CheckAccessString('1234=-;gr1=+', UserAccess('123', ['gr']), am) |
|
|
|
|
assert not CheckAccessString('1234=+;gr=+', UserAccess('123', ['gr1']), am) |
|
|
|
|
assert not CheckAccessString('1234=-;gr=+', UserAccess('123', ['gr1']), am) |
|
|
|
|
|
|
|
|
|
assert CheckAccessString('123=-;1234=a', UserAccess('1234', []), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;1234=d', UserAccess('1234', []), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;1234=e', UserAccess('1234', []), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;1234=r', UserAccess('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;1234=v', UserAccess('1234', []), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;gr1=a', UserAccess('1234', ['gr1']), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;gr1=d', UserAccess('1234', ['gr1']), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;gr1=e', UserAccess('1234', ['gr1']), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;gr1=r', UserAccess('1234', ['gr1']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;gr1=v', UserAccess('1234', ['gr1']), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;1234=daver', UserAccess('1234', []), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;1234=dav', UserAccess('1234', []), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;1234=edv', UserAccess('1234', []), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;1234=rav', UserAccess('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;1234=va', UserAccess('1234', []), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;gr1=avr', UserAccess('1234', ['gr1']), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;gr1=daver', UserAccess('1234', ['gr1']), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;gr1=eva', UserAccess('1234', ['gr1']), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;gr1=re', UserAccess('1234', ['gr1']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;gr1=vad', UserAccess('1234', ['gr1']), AccessMode.VIEW) |
|
|
|
|
|
|
|
|
|
assert not CheckAccessString('123=-;1234=d', UserAccess('1234', []), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;1234=a', UserAccess('1234', []), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;1234=r', UserAccess('1234', []), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;1234=v', UserAccess('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;1234=e', UserAccess('1234', []), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=d', UserAccess('1234', ['gr']), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=a', UserAccess('1234', ['gr']), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=v', UserAccess('1234', ['gr']), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=e', UserAccess('1234', ['gr']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=r', UserAccess('1234', ['gr']), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;1234=dver', UserAccess('1234', []), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;1234=av', UserAccess('1234', []), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;1234=dv', UserAccess('1234', []), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;1234=av', UserAccess('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;1234=a', UserAccess('1234', []), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=vr', UserAccess('1234', ['gr']), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=aver', UserAccess('1234', ['gr']), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=va', UserAccess('1234', ['gr']), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=ea', UserAccess('1234', ['gr']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=ad', UserAccess('1234', ['gr']), AccessMode.VIEW) |
|
|
|
|
|
|
|
|
|
assert CheckAccessString('123=-;other=a', UserAccess('1234', []), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;other=d', UserAccess('1234', []), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;other=e', UserAccess('1234', []), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=r', UserAccess('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=v', UserAccess('1234', []), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;other=a', UserAccess('1234', ['gr1']), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;other=d', UserAccess('1234', ['gr1']), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;other=e', UserAccess('1234', ['gr1']), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=r', UserAccess('1234', ['gr1']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=v', UserAccess('1234', ['gr1']), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;other=daver', UserAccess('1234', []), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;other=dav', UserAccess('1234', []), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;other=edv', UserAccess('1234', []), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=rav', UserAccess('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=va', UserAccess('1234', []), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;other=avr', UserAccess('1234', ['gr1']), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;other=daver', UserAccess('1234', ['gr1']), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;other=eva', UserAccess('1234', ['gr1']), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=re', UserAccess('1234', ['gr1']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=vad', UserAccess('1234', ['gr1']), AccessMode.VIEW) |
|
|
|
|
|
|
|
|
|
assert not CheckAccessString('123=-;other=d', UserAccess('1234', []), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;other=a', UserAccess('1234', []), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;other=r', UserAccess('1234', []), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=v', UserAccess('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=e', UserAccess('1234', []), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=d;other=-', UserAccess('1234', ['gr']), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=a;other=-', UserAccess('1234', ['gr']), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=v;other=-', UserAccess('1234', ['gr']), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=e;other=-', UserAccess('1234', ['gr']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=r;other=-', UserAccess('1234', ['gr']), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;other=dver', UserAccess('1234', []), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;other=av', UserAccess('1234', []), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;other=dv', UserAccess('1234', []), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=av', UserAccess('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=a', UserAccess('1234', []), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;other=vr', UserAccess('1234', ['gr']), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;other=aver', UserAccess('1234', ['gr']), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;other=va', UserAccess('1234', ['gr']), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=ea', UserAccess('1234', ['gr']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=ad', UserAccess('1234', ['gr']), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('1234=+', UserGroups('1234', []), am) |
|
|
|
|
assert not CheckAccessString('1234=-', UserGroups('1234', []), am) |
|
|
|
|
assert CheckAccessString('1234=+;gr1=+', UserGroups('1234', ['gr1']), am) |
|
|
|
|
assert CheckAccessString('1234=-;gr1=+', UserGroups('1234', ['gr1']), am) |
|
|
|
|
assert not CheckAccessString('1234=+', UserGroups('123', []), am) |
|
|
|
|
assert not CheckAccessString('1234=-', UserGroups('123', []), am) |
|
|
|
|
assert not CheckAccessString('1234=+;gr1=+', UserGroups('123', ['gr']), am) |
|
|
|
|
assert not CheckAccessString('1234=-;gr1=+', UserGroups('123', ['gr']), am) |
|
|
|
|
assert not CheckAccessString('1234=+;gr=+', UserGroups('123', ['gr1']), am) |
|
|
|
|
assert not CheckAccessString('1234=-;gr=+', UserGroups('123', ['gr1']), am) |
|
|
|
|
|
|
|
|
|
assert CheckAccessString('123=-;1234=a', UserGroups('1234', []), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;1234=d', UserGroups('1234', []), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;1234=e', UserGroups('1234', []), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;1234=r', UserGroups('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;1234=v', UserGroups('1234', []), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;gr1=a', UserGroups('1234', ['gr1']), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;gr1=d', UserGroups('1234', ['gr1']), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;gr1=e', UserGroups('1234', ['gr1']), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;gr1=r', UserGroups('1234', ['gr1']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;gr1=v', UserGroups('1234', ['gr1']), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;1234=daver', UserGroups('1234', []), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;1234=dav', UserGroups('1234', []), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;1234=edv', UserGroups('1234', []), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;1234=rav', UserGroups('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;1234=va', UserGroups('1234', []), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;gr1=avr', UserGroups('1234', ['gr1']), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;gr1=daver', UserGroups('1234', ['gr1']), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;gr1=eva', UserGroups('1234', ['gr1']), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;gr1=re', UserGroups('1234', ['gr1']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;gr1=vad', UserGroups('1234', ['gr1']), AccessMode.VIEW) |
|
|
|
|
|
|
|
|
|
assert not CheckAccessString('123=-;1234=d', UserGroups('1234', []), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;1234=a', UserGroups('1234', []), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;1234=r', UserGroups('1234', []), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;1234=v', UserGroups('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;1234=e', UserGroups('1234', []), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=d', UserGroups('1234', ['gr']), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=a', UserGroups('1234', ['gr']), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=v', UserGroups('1234', ['gr']), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=e', UserGroups('1234', ['gr']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=r', UserGroups('1234', ['gr']), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;1234=dver', UserGroups('1234', []), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;1234=av', UserGroups('1234', []), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;1234=dv', UserGroups('1234', []), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;1234=av', UserGroups('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;1234=a', UserGroups('1234', []), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=vr', UserGroups('1234', ['gr']), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=aver', UserGroups('1234', ['gr']), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=va', UserGroups('1234', ['gr']), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=ea', UserGroups('1234', ['gr']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=ad', UserGroups('1234', ['gr']), AccessMode.VIEW) |
|
|
|
|
|
|
|
|
|
assert CheckAccessString('123=-;other=a', UserGroups('1234', []), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;other=d', UserGroups('1234', []), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;other=e', UserGroups('1234', []), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=r', UserGroups('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=v', UserGroups('1234', []), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;other=a', UserGroups('1234', ['gr1']), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;other=d', UserGroups('1234', ['gr1']), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;other=e', UserGroups('1234', ['gr1']), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=r', UserGroups('1234', ['gr1']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=v', UserGroups('1234', ['gr1']), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;other=daver', UserGroups('1234', []), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;other=dav', UserGroups('1234', []), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;other=edv', UserGroups('1234', []), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=rav', UserGroups('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=va', UserGroups('1234', []), AccessMode.VIEW) |
|
|
|
|
assert CheckAccessString('123=-;other=avr', UserGroups('1234', ['gr1']), AccessMode.ADD) |
|
|
|
|
assert CheckAccessString('123=-;other=daver', UserGroups('1234', ['gr1']), AccessMode.DELETE) |
|
|
|
|
assert CheckAccessString('123=-;other=eva', UserGroups('1234', ['gr1']), AccessMode.EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=re', UserGroups('1234', ['gr1']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert CheckAccessString('123=-;other=vad', UserGroups('1234', ['gr1']), AccessMode.VIEW) |
|
|
|
|
|
|
|
|
|
assert not CheckAccessString('123=-;other=d', UserGroups('1234', []), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;other=a', UserGroups('1234', []), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;other=r', UserGroups('1234', []), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=v', UserGroups('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=e', UserGroups('1234', []), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=d;other=-', UserGroups('1234', ['gr']), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=a;other=-', UserGroups('1234', ['gr']), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=v;other=-', UserGroups('1234', ['gr']), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=e;other=-', UserGroups('1234', ['gr']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;gr1=r;other=-', UserGroups('1234', ['gr']), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;other=dver', UserGroups('1234', []), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;other=av', UserGroups('1234', []), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;other=dv', UserGroups('1234', []), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=av', UserGroups('1234', []), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=a', UserGroups('1234', []), AccessMode.VIEW) |
|
|
|
|
assert not CheckAccessString('123=-;other=vr', UserGroups('1234', ['gr']), AccessMode.ADD) |
|
|
|
|
assert not CheckAccessString('123=-;other=aver', UserGroups('1234', ['gr']), AccessMode.DELETE) |
|
|
|
|
assert not CheckAccessString('123=-;other=va', UserGroups('1234', ['gr']), AccessMode.EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=ea', UserGroups('1234', ['gr']), AccessMode.ACCEES_EDIT) |
|
|
|
|
assert not CheckAccessString('123=-;other=ad', UserGroups('1234', ['gr']), AccessMode.VIEW) |
|
|
|
|
|
|
|
|
|