1
0

Fixed getting all lists of one namespace

This commit is contained in:
kolaente
2018-07-04 08:56:52 +02:00
parent b57ca9375a
commit f59917e721
7 changed files with 68 additions and 56 deletions

View File

@ -47,15 +47,15 @@ func (user *User) IsNamespaceAdmin(namespace *Namespace) (ok bool, err error) {
return
}
func (user *User) HasNamespaceAccess(namespace *Namespace) (has bool, err error) {
func (user *User) HasNamespaceAccess(namespace *Namespace) (err error) {
// Owners always have access
if user.ID == namespace.Owner.ID {
return true, nil
return nil
}
// Check if the user is in a team which has access to the namespace
return
return ErrUserDoesNotHaveAccessToNamespace{UserID:user.ID, NamespaceID:namespace.ID}
}
func GetNamespaceByID(id int64) (namespace Namespace, err error) {