implemented binding url params directly to struct instead of passing them to the method for deleting items
This commit is contained in:
@ -77,8 +77,8 @@ func (n *Namespace) CanUpdate(user *User, id int64) bool {
|
||||
}
|
||||
|
||||
// CanDelete checks if the user can delete a namespace
|
||||
func (n *Namespace) CanDelete(user *User, id int64) bool {
|
||||
nn, _ := GetNamespaceByID(id)
|
||||
func (n *Namespace) CanDelete(user *User) bool {
|
||||
nn, _ := GetNamespaceByID(n.ID)
|
||||
return nn.IsAdmin(user)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user