Skip to content

Commit

Permalink
Merge pull request #92 from cvaroqui/master
Browse files Browse the repository at this point in the history
Fix stack in rbac for objects in the root namespace
  • Loading branch information
cvaroqui committed Mar 12, 2020
2 parents 7b4a804 + 3aba4e6 commit b20c929
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/osvcd_lsnr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ def rbac_requires(self, namespaces=None, roles=None, action=None, grants=None, p
if "root" in grants:
return
if isinstance(namespaces, (list, tuple)):
namespaces = set(namespaces)
namespaces = set([ns if ns is not None else "root" for ns in namespaces])
elif namespaces == "FROM:path":
if path is None:
raise HTTP(400, "handler '%s' rbac access namespaces FROM:path but no path passed" % action)
Expand Down Expand Up @@ -1578,7 +1578,7 @@ def format_grants(grants):
elif not namespaces:
pass
else:
elements.append("%s:%s" % (role, ",".join(namespaces)))
elements.append("%s:%s" % (role, ",".join([ns if ns is not None else "root" for ns in namespaces])))
return " ".join(elements)

#########################################################################
Expand Down

0 comments on commit b20c929

Please sign in to comment.