Преглед на файлове

[minor] [fix] only for

version-14
Anand Doshi преди 11 години
родител
ревизия
034eae66f4
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. +4
    -4
      webnotes/__init__.py

+ 4
- 4
webnotes/__init__.py Целия файл

@@ -252,10 +252,10 @@ def whitelist(allow_guest=False):
def only_for(roles):
if not isinstance(roles, (tuple, list)):
roles = (roles,)
myroles = get_roles()
for role in roles:
if role not in myroles:
raise PermissionError
roles = set(roles)
myroles = set(get_roles())
if not roles.intersection(myroles):
raise PermissionError

class HashAuthenticatedCommand(object):
def __init__(self):


Зареждане…
Отказ
Запис