1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

implemented view users permission

This commit is contained in:
Harvey Kandola 2017-10-04 12:27:56 -04:00
parent f5f30d2322
commit 30321781c2
13 changed files with 423 additions and 388 deletions

View file

@ -166,14 +166,16 @@ func (m *middleware) Authorize(w http.ResponseWriter, r *http.Request, next http
// user state. This helps client-side applications to detect changes in
// user state/privileges.
var state struct {
Active bool `json:"active"`
Admin bool `json:"admin"`
Editor bool `json:"editor"`
Active bool `json:"active"`
Admin bool `json:"admin"`
Editor bool `json:"editor"`
ViewUsers bool `json:"viewUsers"`
}
state.Active = u.Active
state.Admin = u.Admin
state.Editor = u.Editor
state.ViewUsers = u.ViewUsers
sb, err := json.Marshal(state)
w.Header().Add("X-Documize-Status", string(sb))