File tree Expand file tree Collapse file tree 1 file changed +3
-24
lines changed Expand file tree Collapse file tree 1 file changed +3
-24
lines changed Original file line number Diff line number Diff line change 34
34
'middlewares ' => 'dbAuth,authorization ' ,
35
35
'dbAuth.mode ' => 'optional ' ,
36
36
'dbAuth.registerUser ' => '1 ' ,
37
- 'dbAuth.returnedColumns ' => 'id,username ' ,
38
- 'authorization.tableHandler ' => function ($ operation , $ tableName ) {
39
- // Disallow user table for delete operations
40
- if ($ operation === 'delete ' && $ tableName === 'users ' ) {
41
- return false ;
42
- }
43
- // No other table limitation
37
+ 'authorization.tableHandler ' => function ($ operation , $ tableName ) {
38
+ if ($ tableName === 'users ' ) return false ;
44
39
return true ;
45
- },
46
- 'authorization.columnHandler ' => function ($ operation , $ tableName , $ columnName ) {
47
- // Hide user/password column
48
- if (($ operation === 'read ' || $ operation === 'list ' ) && $ tableName === 'users ' && $ columnName === 'password ' ) {
49
- return false ;
50
- }
51
- // No other column limitation
52
- return true ;
53
- },
54
- 'authorization.recordHandler ' => function ($ operation , $ tableName ) {
55
- // Limit user records to same user
56
- if ($ tableName === 'users ' && $ operation !== 'create ' ) {
57
- return 'filter=id,eq, ' . USERID ;
58
- }
59
- // No other record limitation
60
- return true ;
61
- }
40
+ }
62
41
63
42
]);
64
43
You can’t perform that action at this time.
0 commit comments