Sha256: c83ed56f1a0d484c0d24f2c0adf842b823c2a85b01649933889d7ea292694d18

Contents?: true

Size: 493 Bytes

Versions: 3

Compression:

Stored size: 493 Bytes

Contents

# Permission 是权限。

class Unidom::Authorization::Permission < Unidom::Authorization::ApplicationRecord

  self.table_name = 'unidom_permissions'

  include Unidom::Common::Concerns::ModelExtension
  include Unidom::Authorization::Concerns::AsPermission

  validates :name, presence:    true, length: { in: 2..self.columns_hash['name'].limit }
  validates :path, allow_blank: true, length: { in: 2..self.columns_hash['path'].limit }

  scope :path_is, ->(path) { where path: path }

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
unidom-authorization-1.4.3 app/models/unidom/authorization/permission.rb
unidom-authorization-1.4.2 app/models/unidom/authorization/permission.rb
unidom-authorization-1.4.1 app/models/unidom/authorization/permission.rb