perm.go 290 B

1234567891011121314
  1. package worker
  2. import "net/http"
  3. // examples:.
  4. // permPolicy.On("*")
  5. // permPolicy.On("workers:upload_posts")
  6. const (
  7. PermEdit = "perm_worker_edit"
  8. )
  9. func editIsAllowed(r *http.Request, jobName string) error {
  10. return permVerifier.Do(PermEdit).SnakeOn(jobName).WithReq(r).IsAllowed()
  11. }