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:
@ -47,7 +47,7 @@ func TestNamespace_Create(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
|
||||
// check if it really exists
|
||||
allowed, err = dummynamespace.CanRead(doer)
|
||||
allowed, _, err = dummynamespace.CanRead(doer)
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, allowed)
|
||||
err = dummynamespace.ReadOne()
|
||||
@ -78,7 +78,7 @@ func TestNamespace_Create(t *testing.T) {
|
||||
// Check if it was updated
|
||||
assert.Equal(t, "Dolor sit amet.", dummynamespace.Description)
|
||||
// Get it and check it again
|
||||
allowed, err = dummynamespace.CanRead(doer)
|
||||
allowed, _, err = dummynamespace.CanRead(doer)
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, allowed)
|
||||
err = dummynamespace.ReadOne()
|
||||
@ -116,7 +116,7 @@ func TestNamespace_Create(t *testing.T) {
|
||||
assert.True(t, IsErrNamespaceDoesNotExist(err))
|
||||
|
||||
// Check if it was successfully deleted
|
||||
allowed, err = dummynamespace.CanRead(doer)
|
||||
allowed, _, err = dummynamespace.CanRead(doer)
|
||||
assert.False(t, allowed)
|
||||
assert.Error(t, err)
|
||||
assert.True(t, IsErrNamespaceDoesNotExist(err))
|
||||
|
Reference in New Issue
Block a user