src/Auth/Database/Permission.php 1 location
|
@@ 45-52 (lines=8) @@
|
42 |
|
* |
43 |
|
* @return BelongsToMany |
44 |
|
*/ |
45 |
|
public function roles() : BelongsToMany |
46 |
|
{ |
47 |
|
$pivotTable = config('admin.database.role_permissions_table'); |
48 |
|
|
49 |
|
$relatedModel = config('admin.database.roles_model'); |
50 |
|
|
51 |
|
return $this->belongsToMany($relatedModel, $pivotTable, 'permission_id', 'role_id'); |
52 |
|
} |
53 |
|
|
54 |
|
/** |
55 |
|
* If request should pass through the current permission. |
src/Auth/Database/Role.php 1 location
|
@@ 47-54 (lines=8) @@
|
44 |
|
* |
45 |
|
* @return BelongsToMany |
46 |
|
*/ |
47 |
|
public function permissions() : BelongsToMany |
48 |
|
{ |
49 |
|
$pivotTable = config('admin.database.role_permissions_table'); |
50 |
|
|
51 |
|
$relatedModel = config('admin.database.permissions_model'); |
52 |
|
|
53 |
|
return $this->belongsToMany($relatedModel, $pivotTable, 'role_id', 'permission_id'); |
54 |
|
} |
55 |
|
|
56 |
|
/** |
57 |
|
* Check user has permission. |