MCPcopy Index your code
hub / github.com/pyload/pyload / parse_permissions

Function parse_permissions

module/web/utils.py:32–48  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

30
31
32def parse_permissions(session):
33 perms = dict([(x, False) for x in dir(PERMS) if not x.startswith("_")])
34 perms["ADMIN"] = False
35 perms["is_admin"] = False
36
37 if not session.get("authenticated", False):
38 return perms
39
40 if session.get("role") == ROLE.ADMIN:
41 for k in perms.iterkeys():
42 perms[k] = True
43
44 elif session.get("perms"):
45 p = session.get("perms")
46 get_permission(perms, p)
47
48 return perms
49
50
51def permlist():

Callers 2

pre_processorFunction · 0.90
_viewFunction · 0.85

Calls 4

dictFunction · 0.85
get_permissionFunction · 0.85
getMethod · 0.45
iterkeysMethod · 0.45

Tested by

no test coverage detected