1
0

Implemented CanCreate method

This commit is contained in:
konrad
2018-07-12 23:16:32 +02:00
committed by kolaente
parent 6fd2a97574
commit ddcc063b0b
6 changed files with 26 additions and 9 deletions

View File

@ -28,6 +28,11 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
}
}
// Check rights
if !c.CObject.CanCreate(&currentUser, id) {
return echo.NewHTTPError(http.StatusForbidden)
}
// Create
err = c.CObject.Create(&currentUser, id)
if err != nil {