1
0

Return rights when reading a single item (#626)

Fix lint

Update docs

Fix loading all rights (list & namespace)

Add tests

Update web framework

Make tests run again

Update all calls to CanRead methods

Update task attachment & task comment & task rights to return the max right

Update team rights to return the max right

Update namespace rights to return the max right

Update list rights to return the max right

Update link share rights to return the max right

Update label rights to return the max right

Update web dependency

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/626
This commit is contained in:
konrad
2020-08-10 12:11:43 +00:00
parent 28b8cabea5
commit bd8c1c3bb7
36 changed files with 165 additions and 68 deletions

View File

@ -79,7 +79,7 @@ func getNamespace(c echo.Context) (namespace *models.Namespace, err error) {
return
}
namespace = &models.Namespace{ID: namespaceID}
canRead, err := namespace.CanRead(user)
canRead, _, err := namespace.CanRead(user)
if err != nil {
return namespace, err
}

View File

@ -119,7 +119,7 @@ func GetTaskAttachment(c echo.Context) error {
if err != nil {
return handler.HandleHTTPError(err, c)
}
can, err := taskAttachment.CanRead(auth)
can, _, err := taskAttachment.CanRead(auth)
if err != nil {
return handler.HandleHTTPError(err, c)
}

View File

@ -78,7 +78,7 @@ func ListUsersForList(c echo.Context) error {
return handler.HandleHTTPError(err, c)
}
canRead, err := list.CanRead(auth)
canRead, _, err := list.CanRead(auth)
if err != nil {
return handler.HandleHTTPError(err, c)
}