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

anon user space/categopry handling

This commit is contained in:
Harvey Kandola 2017-10-04 13:27:48 -04:00
parent 30321781c2
commit 7ce3adb65e
8 changed files with 36 additions and 38 deletions

View file

@ -300,7 +300,7 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request) {
response.WriteJSON(w, sp)
}
// GetAll returns spaces the user can see.
// GetAlGetViewablel returns spaces the user can see.
func (h *Handler) GetViewable(w http.ResponseWriter, r *http.Request) {
method := "space.GetViewable"
ctx := domain.GetRequestContext(r)
@ -312,7 +312,6 @@ func (h *Handler) GetViewable(w http.ResponseWriter, r *http.Request) {
h.Runtime.Log.Error(method, err)
return
}
if len(sp) == 0 {
sp = []space.Space{}
}
@ -320,7 +319,6 @@ func (h *Handler) GetViewable(w http.ResponseWriter, r *http.Request) {
response.WriteJSON(w, sp)
}
// GetAll returns every space for documize admin users to manage
func (h *Handler) GetAll(w http.ResponseWriter, r *http.Request) {
method := "space.getAll"
@ -329,7 +327,7 @@ func (h *Handler) GetAll(w http.ResponseWriter, r *http.Request) {
if !ctx.Administrator {
response.WriteForbiddenError(w)
h.Runtime.Log.Info("rejected non-admin user request for all spaces")
return
return
}
sp, err := h.Store.Space.GetAll(ctx)