Skip to content

Commit

Permalink
Merge pull request #1023 from uasoft-indonesia/analysis-YOmJ6Y
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rahmatalmubarak authored Aug 10, 2023
2 parents 81daa01 + 0adbb20 commit 2ed51b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(array $attributes = [])

public static function generateFor($table_name, $is_maintenance = false)
{
if (!Permission::where('table_name', $table_name)->first()) {
if (! Permission::where('table_name', $table_name)->first()) {
$permissions = [];
$permissions[] = self::firstOrCreate(['key' => 'browse_'.$table_name, 'description' => 'Browse '.$table_name, 'table_name' => $table_name, 'roles_can_see_all_data' => '["administrator"]', 'field_identify_related_user' => 'user_id']);
$permissions[] = self::firstOrCreate(['key' => 'read_'.$table_name, 'description' => 'Read '.$table_name, 'table_name' => $table_name, 'roles_can_see_all_data' => '["administrator"]', 'field_identify_related_user' => 'user_id']);
Expand Down Expand Up @@ -104,7 +104,7 @@ public static function generateForTableCRUD()
foreach ($get_all_table_name as $key => $table) {
$permission_table_name = Permission::where('table_name', $table->name)->get();
foreach ($permission_table_name as $key => $table_name) {
if ($table->roles_can_see_all_data == NULL && $table_name->field_identify_related_user == NULL) {
if ($table->roles_can_see_all_data == null && $table_name->field_identify_related_user == null) {
$table_name->roles_can_see_all_data = '["administrator"]';
$table_name->field_identify_related_user = 'user_id';
$table_name->save();
Expand Down

0 comments on commit 2ed51b4

Please sign in to comment.