From 422662e3e1df64b7c06ba7f50ba7481df71cc1e3 Mon Sep 17 00:00:00 2001 From: konrad Date: Tue, 4 Sep 2018 19:54:15 +0200 Subject: [PATCH] updated featurecreep --- Featurecreep.md | 1 - REST-Tests/lists.http | 2 +- models/list_rights.go | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Featurecreep.md b/Featurecreep.md index 127403720..44d939072 100644 --- a/Featurecreep.md +++ b/Featurecreep.md @@ -136,7 +136,6 @@ Teams sind global, d.h. Ein Team kann mehrere Namespaces verwalten. * [ ] Mit anderen Nutzern // TODO: bei canRead/etc die Einträge beachten * [ ] Namespaces - * [ ] Teams * [x] Teams * [ ] Mit Link * [ ] Offen diff --git a/REST-Tests/lists.http b/REST-Tests/lists.http index 327360c17..399127dcd 100644 --- a/REST-Tests/lists.http +++ b/REST-Tests/lists.http @@ -5,7 +5,7 @@ Authorization: Bearer {{auth_token}} ### # Get one list -GET http://localhost:8080/api/v1/lists/10 +GET http://localhost:8080/api/v1/lists/13 Authorization: Bearer {{auth_token}} ### diff --git a/models/list_rights.go b/models/list_rights.go index 00221b691..a4a27a3c7 100644 --- a/models/list_rights.go +++ b/models/list_rights.go @@ -7,6 +7,8 @@ func (l *List) IsAdmin(user *User) bool { return true } + // Check individual rights + return l.checkListTeamRight(user, TeamRightAdmin) } @@ -17,6 +19,8 @@ func (l *List) CanWrite(user *User) bool { return true } + // Check individual rights + // Admins always have write access if l.IsAdmin(user) { return true @@ -32,6 +36,8 @@ func (l *List) CanRead(user *User) bool { return true } + // Check individual rights + // Admins always have read access if l.IsAdmin(user) { return true