Skip to content

Commit

Permalink
abac bismillah
Browse files Browse the repository at this point in the history
  • Loading branch information
emreakay committed Oct 25, 2022
1 parent 2511805 commit 6fe18f3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions README-abac.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ todo
---

- docs
-
-

todo v2
---

- unit test improvements
- AbacUtil validation improvements
- AbacRules() and AbacArray Validation together
- interface tests


backlog
---

- config e aranacak model klasörü eklenecek ?? AStart a mı eklemek lazım?
- abac rule'u eloquent'a - dönüştüren builder ?? şimdilik scope içinden yapıldı

Expand Down Expand Up @@ -69,3 +70,18 @@ backlog
]

```

```php

[
"&&" => [
["=" => [ "attribute" => "model", "value" => "opel"]],
[">" => [ "attribute" => "age", "value" => "2020"]],
"||" => [
["=" => [ "attribute" => "model", "value" => "mercedes"]],
]
],
]
]

```
3 changes: 2 additions & 1 deletion tests/Models/OrganizationNodeable.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public function getModelName(): ?string
public static function getABACRules(): array
{
return [
'name' => [ABACCondition::equal, ABACCondition::greater_than_or_equal_to],
'name' => [ABACCondition::equal, ABACCondition::like],
'age' => [ABACCondition::equal, ABACCondition::greater_then],
'id' => [ABACCondition::equal, ABACCondition::greater_than_or_equal_to],
];
}
Expand Down
1 change: 0 additions & 1 deletion tests/Unit/ABACTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use AuroraWebSoftware\AAuth\Utils\ABACUtil;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

beforeEach(function () {
Expand Down

0 comments on commit 6fe18f3

Please sign in to comment.