WebAdmin: refactor template permissions

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-11-26 20:39:36 +01:00
parent 0f9314f900
commit d3e76898cd
12 changed files with 372 additions and 465 deletions

View File

@@ -1794,7 +1794,7 @@ func TestJWTTokenValidation(t *testing.T) {
assert.Equal(t, webClientLoginPath, rr.Header().Get("Location"))
errTest := errors.New("test error")
permFn := server.checkPerm(dataprovider.PermAdminAny)
permFn := server.checkPerms(dataprovider.PermAdminAny)
fn = permFn(r)
rr = httptest.NewRecorder()
req, _ = http.NewRequest(http.MethodGet, userPath, nil)
@@ -1802,7 +1802,7 @@ func TestJWTTokenValidation(t *testing.T) {
fn.ServeHTTP(rr, req.WithContext(ctx))
assert.Equal(t, http.StatusBadRequest, rr.Code)
permFn = server.checkPerm(dataprovider.PermAdminAny)
permFn = server.checkPerms(dataprovider.PermAdminAny)
fn = permFn(r)
rr = httptest.NewRecorder()
req, _ = http.NewRequest(http.MethodGet, webUserPath, nil)