forked from akaunting/akaunting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
laratrust.php
182 lines (158 loc) · 4.99 KB
/
laratrust.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php
/**
* This file is part of Laratrust,
* a role & permission management solution for Laravel.
*
* @license MIT
* @package Laratrust
*/
return [
/*
|--------------------------------------------------------------------------
| Use MorphMap in relationships between models
|--------------------------------------------------------------------------
|
| If true, the morphMap feature is going to be used. The array values that
| are going to be used are the ones inside the 'user_models' array.
|
*/
'use_morph_map' => true,
/*
|--------------------------------------------------------------------------
| Use teams feature in the package
|--------------------------------------------------------------------------
|
| Defines if Laratrust will use the teams feature.
| Please check the docs to see what you need to do in case you have the package already configured.
|
*/
'use_teams' => false,
/*
|--------------------------------------------------------------------------
| Laratrust User Models
|--------------------------------------------------------------------------
|
| This is the array that contains the information of the user models.
| This information is used in the add-trait command, and for the roles and
| permissions relationships with the possible user models.
|
| The key in the array is the name of the relationship inside the roles and permissions.
|
*/
'user_models' => [
'users' => 'App\Models\Auth\User',
],
/*
|--------------------------------------------------------------------------
| Laratrust Models
|--------------------------------------------------------------------------
|
| These are the models used by Laratrust to define the roles, permissions and teams.
| If you want the Laratrust models to be in a different namespace or
| to have a different name, you can do it here.
|
*/
'models' => [
/**
* Role model
*/
'role' => 'App\Models\Auth\Role',
/**
* Permission model
*/
'permission' => 'App\Models\Auth\Permission',
/**
* Team model
*/
'team' => 'App\Models\Auth\Team',
],
/*
|--------------------------------------------------------------------------
| Laratrust Tables
|--------------------------------------------------------------------------
|
| These are the tables used by Laratrust to store all the authorization data.
|
*/
'tables' => [
/**
* Roles table.
*/
'roles' => 'roles',
/**
* Permissions table.
*/
'permissions' => 'permissions',
/**
* Teams table.
*/
'teams' => 'teams',
/**
* Role - User intermediate table.
*/
'role_user' => 'user_roles',
/**
* Permission - User intermediate table.
*/
'permission_user' => 'user_permissions',
/**
* Permission - Role intermediate table.
*/
'permission_role' => 'role_permissions',
],
/*
|--------------------------------------------------------------------------
| Laratrust Foreign Keys
|--------------------------------------------------------------------------
|
| These are the foreign keys used by laratrust in the intermediate tables.
|
*/
'foreign_keys' => [
/**
* User foreign key on Laratrust's role_user and permission_user tables.
*/
'user' => 'user_id',
/**
* Role foreign key on Laratrust's role_user and permission_role tables.
*/
'role' => 'role_id',
/**
* Role foreign key on Laratrust's permission_user and permission_role tables.
*/
'permission' => 'permission_id',
/**
* Role foreign key on Laratrust's role_user and permission_user tables.
*/
'team' => 'team_id',
],
/*
|--------------------------------------------------------------------------
| Laratrust Middleware
|--------------------------------------------------------------------------
|
| This configuration helps to customize the Laratrust middlewares behavior.
|
*/
'middleware' => [
/**
* Method to be called in the middleware return case.
* Available: abort|redirect
*/
'handling' => 'redirect',
/**
* Parameter passed to the middleware_handling method
*/
'params' => 'auth/login',
],
/*
|--------------------------------------------------------------------------
| Laratrust Magic 'can' Method
|--------------------------------------------------------------------------
|
| Supported cases for the magic can method (Refer to the docs).
| Available: camel_case|snake_case|kebab_case
|
*/
'magic_can_method_case' => 'kebab_case',
];