Have got uploads working
This commit is contained in:
parent
97112d99dd
commit
6b697e008f
20 changed files with 751 additions and 7 deletions
|
|
@ -57,6 +57,13 @@ func (s *Service) fetchPostAndSite(ctx context.Context, pid int64) (*models.Post
|
|||
return nil, models.Site{}, models.SiteRequiredError
|
||||
}
|
||||
|
||||
user, ok := models.GetUser(ctx)
|
||||
if !ok {
|
||||
return nil, models.Site{}, models.UserRequiredError
|
||||
} else if site.OwnerID != user.ID {
|
||||
return nil, models.Site{}, models.PermissionError
|
||||
}
|
||||
|
||||
post, err := s.db.SelectPost(ctx, pid)
|
||||
if err != nil {
|
||||
return nil, models.Site{}, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue