Skip to content

Commit

Permalink
Add rights() method to Category, Product, Stock, and Type models
Browse files Browse the repository at this point in the history
  • Loading branch information
dedanirungu committed Apr 12, 2024
1 parent 06795a7 commit 3681567
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Entities/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public function fields(Blueprint $table = null): void
*/
public function rights(): array
{
$rights = parent::rights();

$rights['staff'] = ['view' => true];
$rights['registered'] = ['view' => true];
$rights['guest'] = [];

return $rights;
}
}
6 changes: 6 additions & 0 deletions Entities/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public function structure($structure): array
*/
public function rights(): array
{
$rights = parent::rights();

$rights['staff'] = ['view' => true];
$rights['registered'] = ['view' => true];
$rights['guest'] = [];

return $rights;
}
}
6 changes: 6 additions & 0 deletions Entities/Stock.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ public function structure($structure): array
*/
public function rights(): array
{
$rights = parent::rights();

$rights['staff'] = ['view' => true];
$rights['registered'] = ['view' => true];
$rights['guest'] = [];

return $rights;
}
}
6 changes: 6 additions & 0 deletions Entities/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public function fields(Blueprint $table = null): void
*/
public function rights(): array
{
$rights = parent::rights();

$rights['staff'] = ['view' => true];
$rights['registered'] = ['view' => true];
$rights['guest'] = [];

return $rights;
}
}

0 comments on commit 3681567

Please sign in to comment.