Permission add and remove zeroframe api command
This commit is contained in:
parent
523a7d4c16
commit
3d7ba7bdf8
1 changed files with 13 additions and 1 deletions
|
@ -155,7 +155,8 @@ class UiWebsocket(object):
|
||||||
|
|
||||||
admin_commands = (
|
admin_commands = (
|
||||||
"sitePause", "siteResume", "siteDelete", "siteList", "siteSetLimit", "siteClone",
|
"sitePause", "siteResume", "siteDelete", "siteList", "siteSetLimit", "siteClone",
|
||||||
"channelJoinAllsite", "serverUpdate", "serverPortcheck", "serverShutdown", "certSet", "configSet"
|
"channelJoinAllsite", "serverUpdate", "serverPortcheck", "serverShutdown", "certSet", "configSet",
|
||||||
|
"actionPermissionAdd", "actionPermissionRemove"
|
||||||
)
|
)
|
||||||
|
|
||||||
if cmd == "response": # It's a response to a command
|
if cmd == "response": # It's a response to a command
|
||||||
|
@ -564,6 +565,17 @@ class UiWebsocket(object):
|
||||||
|
|
||||||
# - Admin actions -
|
# - Admin actions -
|
||||||
|
|
||||||
|
def actionPermissionAdd(self, to, permission):
|
||||||
|
if permission not in self.site.settings["permissions"]:
|
||||||
|
self.site.settings["permissions"].append(permission)
|
||||||
|
self.site.saveSettings()
|
||||||
|
self.response(to, "ok")
|
||||||
|
|
||||||
|
def actionPermissionRemove(self, to, permission):
|
||||||
|
self.site.settings["permissions"].remove(permission)
|
||||||
|
self.site.saveSettings()
|
||||||
|
self.response(to, "ok")
|
||||||
|
|
||||||
# Set certificate that used for authenticate user for site
|
# Set certificate that used for authenticate user for site
|
||||||
def actionCertSet(self, to, domain):
|
def actionCertSet(self, to, domain):
|
||||||
self.user.setCert(self.site.address, domain)
|
self.user.setCert(self.site.address, domain)
|
||||||
|
|
Loading…
Reference in a new issue