Class: RbacRls::GroupPermission
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- RbacRls::GroupPermission
- Defined in:
- app/models/rbac_rls/group_permission.rb
Instance Method Summary collapse
-
#create_group_rls_policy ⇒ Object
rails generate rbac_rls:group_permission table_name description:table_key ‘produto’:table_value.
Instance Method Details
#create_group_rls_policy ⇒ Object
rails generate rbac_rls:group_permission table_name description:table_key ‘produto’:table_value
9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/rbac_rls/group_permission.rb', line 9 def create_group_rls_policy cmd = "" if self..table_name.present? and self.table_key.present? and self.table_value.present? cmd = "rails generate rbac_rls:group_permission #{self..table_name} '#{self.table_key}':table_key '#{self.table_value}':table_value" end if cmd.present? system(cmd) system('rake db:migrate RAILS_ENV=migrations') end end |