Implemented CanCreate method
This commit is contained in:
parent
6fd2a97574
commit
ddcc063b0b
6 changed files with 26 additions and 9 deletions
|
|
@ -28,6 +28,11 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
|
|||
}
|
||||
}
|
||||
|
||||
// Check rights
|
||||
if !c.CObject.CanCreate(¤tUser, id) {
|
||||
return echo.NewHTTPError(http.StatusForbidden)
|
||||
}
|
||||
|
||||
// Create
|
||||
err = c.CObject.Create(¤tUser, id)
|
||||
if err != nil {
|
||||
|
|
|
|||
Reference in a new issue