diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-10 09:54:33 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-10 09:54:33 +0100 |
commit | 61a76f624decd9d9ef3afadaf584d46fe56e0817 (patch) | |
tree | c5e9e69aef5d8f82e25b738cf23f337d43d518b2 /admin.go | |
parent | b194b5f7eba47cbac677ba28fc9f8e1e29a7ed1a (diff) | |
download | guichet-61a76f624decd9d9ef3afadaf584d46fe56e0817.tar.gz guichet-61a76f624decd9d9ef3afadaf584d46fe56e0817.zip |
Make some values non deletable
Diffstat (limited to 'admin.go')
-rw-r--r-- | admin.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -164,6 +164,7 @@ type PropValues struct { Name string Values []string Editable bool + Deletable bool } func handleAdminLDAP(w http.ResponseWriter, r *http.Request) { @@ -342,10 +343,18 @@ func handleAdminLDAP(w http.ResponseWriter, r *http.Request) { break } } + deletable := true + for _, restricted := range []string{ "displayname", "objectclass", "structuralobjectclass" } { + if strings.EqualFold(attr.Name, restricted) { + deletable = false + break + } + } props[name_lower] = &PropValues{ Name: attr.Name, Values: attr.Values, Editable: editable, + Deletable: deletable, } } } |