Merge pull request #20 from zeronet-conservancy/admin_config
change of ADMIN privilege management
This commit is contained in:
commit
a790c1eee6
3 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
### zeronet-conservancy 0.7.3+ (master)
|
||||||
|
maintainers: @caryoscelus
|
||||||
|
- don't grant ADMIN permission to home or update pages
|
||||||
|
- allow granting ADMIN permission via `--admin_pages` command line option
|
||||||
|
|
||||||
### zeronet-conservancy 0.7.3 (2022-01-21) Rev5000
|
### zeronet-conservancy 0.7.3 (2022-01-21) Rev5000
|
||||||
maintainers: @caryoscelus
|
maintainers: @caryoscelus
|
||||||
- forked from the latest py3 branch of ZeroNet
|
- forked from the latest py3 branch of ZeroNet
|
||||||
|
|
|
@ -260,6 +260,7 @@ class Config(object):
|
||||||
metavar='address')
|
metavar='address')
|
||||||
self.parser.add_argument('--updatesite', help='Source code update site', default='1uPDaT3uSyWAPdCv1WkMb5hBQjWSNNACf',
|
self.parser.add_argument('--updatesite', help='Source code update site', default='1uPDaT3uSyWAPdCv1WkMb5hBQjWSNNACf',
|
||||||
metavar='address')
|
metavar='address')
|
||||||
|
self.parser.add_argument('--admin_pages', help='Pages with admin privileges', default=[], metavar='address', nargs='*')
|
||||||
self.parser.add_argument('--dist_type', help='Type of installed distribution', default='source')
|
self.parser.add_argument('--dist_type', help='Type of installed distribution', default='source')
|
||||||
|
|
||||||
self.parser.add_argument('--size_limit', help='Default site size limit in MB', default=10, type=int, metavar='limit')
|
self.parser.add_argument('--size_limit', help='Default site size limit in MB', default=10, type=int, metavar='limit')
|
||||||
|
|
|
@ -110,8 +110,8 @@ class Site(object):
|
||||||
if config.download_optional == "auto":
|
if config.download_optional == "auto":
|
||||||
self.settings["autodownloadoptional"] = True
|
self.settings["autodownloadoptional"] = True
|
||||||
|
|
||||||
# Add admin permissions to homepage
|
# Add admin permissions according to user settings
|
||||||
if self.address in (config.homepage, config.updatesite) and "ADMIN" not in self.settings["permissions"]:
|
if self.address in config.admin_pages and "ADMIN" not in self.settings["permissions"]:
|
||||||
self.settings["permissions"].append("ADMIN")
|
self.settings["permissions"].append("ADMIN")
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue