Class: RbacRls::GroupPermission

Inherits:
ApplicationRecord show all
Defined in:
app/models/rbac_rls/group_permission.rb

Instance Method Summary collapse

Instance Method Details

#create_group_rls_policyObject

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.permission.table_name.present? and self.table_key.present? and self.table_value.present?
    cmd = "rails generate rbac_rls:group_permission #{self.permission.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