```ruby
class Permission < ActiveRecord::Base
  audited comment_required: true, associated_with: :provider

  belongs_to :role
  delegate :provider, to: :role

  valhammer

  # "word" in the url-safe base64 alphabet, or single '*'
  SEGMENT = /([\w-]+|\*)/
  private_constant :SEGMENT
  validates :value, format: /\A(#{SEGMENT}:)*#{SEGMENT}\z/
end
```

Use Accession::Permission regexp for validation
user
```ruby
class Permission < ActiveRecord::Base
  audited comment_required: true, associated_with: :provider

  belongs_to :role
  delegate :provider, to: :role

  valhammer

  validates :value, format: Accession::Permission.regexp
end
```
assistant