1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-08 10:51:09 +00:00

add 'reader' group

it is essentially the same as 'anon' but 'reader' is allowed to log in
if wiki is locked down.
This commit is contained in:
la-ninpre 2022-09-14 23:35:43 +03:00 committed by Timur Ismagilov
parent 97df77d158
commit fd6889cea3
3 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,7 @@
<div class="form-field"> <div class="form-field">
<select id="group" name="group" aria-label="{{block "group" .}}Group{{end}}"> <select id="group" name="group" aria-label="{{block "group" .}}Group{{end}}">
<option {{if .Form.Get "group" | eq "anon" }}selected{{end}}>anon</option> <option {{if .Form.Get "group" | eq "anon" }}selected{{end}}>anon</option>
<option {{if .Form.Get "group" | eq "reader" }}selected{{end}}>reader</option>
<option {{if .Form.Get "group" | eq "editor" }}selected{{end}}>editor</option> <option {{if .Form.Get "group" | eq "editor" }}selected{{end}}>editor</option>
<option {{if .Form.Get "group" | eq "trusted" }}selected{{end}}>trusted</option> <option {{if .Form.Get "group" | eq "trusted" }}selected{{end}}>trusted</option>
<option {{if .Form.Get "group" | eq "moderator" }}selected{{end}}>moderator</option> <option {{if .Form.Get "group" | eq "moderator" }}selected{{end}}>moderator</option>

View File

@ -25,6 +25,7 @@
<label for="group">{{block "group" .}}Group{{end}}:</label> <label for="group">{{block "group" .}}Group{{end}}:</label>
<select id="group" name="group"> <select id="group" name="group">
<option {{if .Form.Get "group" | eq "anon" }}selected{{end}}>anon</option> <option {{if .Form.Get "group" | eq "anon" }}selected{{end}}>anon</option>
<option {{if .Form.Get "group" | eq "reader" }}selected{{end}}>reader</option>
<option {{if .Form.Get "group" | eq "editor" }}selected{{end}}>editor</option> <option {{if .Form.Get "group" | eq "editor" }}selected{{end}}>editor</option>
<option {{if .Form.Get "group" | eq "trusted" }}selected{{end}}>trusted</option> <option {{if .Form.Get "group" | eq "trusted" }}selected{{end}}>trusted</option>
<option {{if .Form.Get "group" | eq "moderator" }}selected{{end}}>moderator</option> <option {{if .Form.Get "group" | eq "moderator" }}selected{{end}}>moderator</option>

View File

@ -48,6 +48,7 @@ var minimalRights = map[string]int{
var groups = []string{ var groups = []string{
"anon", "anon",
"reader",
"editor", "editor",
"trusted", "trusted",
"moderator", "moderator",
@ -57,6 +58,7 @@ var groups = []string{
// Group — Right level // Group — Right level
var groupRight = map[string]int{ var groupRight = map[string]int{
"anon": 0, "anon": 0,
"reader": 0,
"editor": 1, "editor": 1,
"trusted": 2, "trusted": 2,
"moderator": 3, "moderator": 3,