Class: Unidom::Authorization::Authorizing
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Unidom::Authorization::Authorizing
- Includes:
- Common::Concerns::ModelExtension
- Defined in:
- app/models/unidom/authorization/authorizing.rb
Overview
Authorizing 是授权。
Class Method Summary collapse
Class Method Details
.authorize!(permission, authorized, authorizer = nil, opened_at = Time.now) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'app/models/unidom/authorization/authorizing.rb', line 17 def self.(, , = nil, opened_at = Time.now) attributes = { opened_at: opened_at } if .present? attributes[:authorizer] = else attributes[:authorizer_id] = Unidom::Common::NULL_UUID attributes[:authorizer_type] = '' end self.().().valid_at.alive.first_or_create! attributes end |