mirror of
https://github.com/HelloZeroNet/ZeroNet.git
synced 2023-12-14 04:33:03 +01:00
Add per-cmd site permission query
This commit is contained in:
parent
4a823c57d5
commit
56e80f7c0c
1 changed files with 2 additions and 2 deletions
|
@ -159,7 +159,7 @@ class UiWebsocket(object):
|
|||
return True
|
||||
|
||||
# Has permission to access a site
|
||||
def hasSitePermission(self, address):
|
||||
def hasSitePermission(self, address, cmd=None):
|
||||
if address != self.site.address and "ADMIN" not in self.site.settings["permissions"]:
|
||||
return False
|
||||
else:
|
||||
|
@ -323,7 +323,7 @@ class UiWebsocket(object):
|
|||
# - Actions -
|
||||
|
||||
def actionAs(self, to, address, cmd, params=[]):
|
||||
if not self.hasSitePermission(address):
|
||||
if not self.hasSitePermission(address, cmd=cmd):
|
||||
return self.response(to, "No permission for site %s" % address)
|
||||
req_self = copy.copy(self)
|
||||
req_self.site = self.server.sites.get(address)
|
||||
|
|
Loading…
Reference in a new issue