updated todo
+ fmt
This commit is contained in:
parent
26c2ad078f
commit
7dc8699cbd
4 changed files with 9 additions and 9 deletions
|
@ -136,10 +136,10 @@ Teams sind global, d.h. Ein Team kann mehrere Namespaces verwalten.
|
||||||
* [x] Create
|
* [x] Create
|
||||||
* [x] ReadAll
|
* [x] ReadAll
|
||||||
* [x] Delete
|
* [x] Delete
|
||||||
* [ ] `lists/:id/teams`
|
* [x] `lists/:id/teams`
|
||||||
* [ ] Create
|
* [x] Create
|
||||||
* [ ] ReadAll
|
* [x] ReadAll
|
||||||
* [ ] Delete
|
* [x] Delete
|
||||||
|
|
||||||
#### v0.3
|
#### v0.3
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,7 @@ func (err ErrNeedToBeListWriter) Error() string {
|
||||||
// ErrNeedToHaveListReadAccess represents an error, where the user dont has read access to that List
|
// ErrNeedToHaveListReadAccess represents an error, where the user dont has read access to that List
|
||||||
type ErrNeedToHaveListReadAccess struct {
|
type ErrNeedToHaveListReadAccess struct {
|
||||||
ListID int64
|
ListID int64
|
||||||
UserID int64
|
UserID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsErrNeedToHaveListReadAccess checks if an error is a ErrListDoesNotExist.
|
// IsErrNeedToHaveListReadAccess checks if an error is a ErrListDoesNotExist.
|
||||||
|
@ -438,7 +438,7 @@ func (err ErrInvalidTeamRight) Error() string {
|
||||||
// ErrTeamAlreadyHasAccess represents an error where a team already has access to a list/namespace
|
// ErrTeamAlreadyHasAccess represents an error where a team already has access to a list/namespace
|
||||||
type ErrTeamAlreadyHasAccess struct {
|
type ErrTeamAlreadyHasAccess struct {
|
||||||
TeamID int64
|
TeamID int64
|
||||||
ID int64
|
ID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsErrTeamAlreadyHasAccess checks if an error is ErrTeamAlreadyHasAccess.
|
// IsErrTeamAlreadyHasAccess checks if an error is ErrTeamAlreadyHasAccess.
|
||||||
|
@ -449,4 +449,4 @@ func IsErrTeamAlreadyHasAccess(err error) bool {
|
||||||
|
|
||||||
func (err ErrTeamAlreadyHasAccess) Error() string {
|
func (err ErrTeamAlreadyHasAccess) Error() string {
|
||||||
return fmt.Sprintf("This team already has access. [Team ID: %d, ID: %d]", err.TeamID, err.ID)
|
return fmt.Sprintf("This team already has access. [Team ID: %d, ID: %d]", err.TeamID, err.ID)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,4 @@ func (tl *TeamList) CanCreate(user *User) bool {
|
||||||
func (tl *TeamList) CanDelete(user *User) bool {
|
func (tl *TeamList) CanDelete(user *User) bool {
|
||||||
l, _ := GetListByID(tl.ListID)
|
l, _ := GetListByID(tl.ListID)
|
||||||
return l.IsAdmin(user)
|
return l.IsAdmin(user)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ func (tn *TeamNamespace) Create(doer *User) (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the team already has access to the namespace
|
// Check if the team already has access to the namespace
|
||||||
exists, err := x.Where("team_id = ?", tn.TeamID).
|
exists, err := x.Where("team_id = ?", tn.TeamID).
|
||||||
And("namespace_id = ?", tn.NamespaceID).
|
And("namespace_id = ?", tn.NamespaceID).
|
||||||
|
|
Loading…
Reference in a new issue