@@ -107,7 +107,7 @@ These features match features in v1 (see branch "v1"):
107
107
- [ ] Supports file upload from web forms (multipart/form-data)
108
108
- [ ] ~~ Condensed JSON output: first row contains field names~~
109
109
- [x] Sanitize and validate input using callbacks
110
- - [ ] Permission system for databases, tables, columns and records
110
+ - [x ] Permission system for databases, tables, columns and records
111
111
- [ ] Multi-tenant database layouts are supported
112
112
- [x] Multi-domain CORS support for cross-domain requests
113
113
- [x] Support for reading joined results from multiple tables
@@ -158,6 +158,7 @@ You can tune the middleware behavior using middleware specific configuration par
158
158
- "cors.maxAge": The time that the CORS grant is valid in seconds ("1728000")
159
159
- "authorization.tableHandler": Handler to implement table authorization rules ("")
160
160
- "authorization.columnHandler": Handler to implement column authorization rules ("")
161
+ - "authorization.recordHandler": Handler to implement record authorization filter rules ("")
161
162
- "basicAuth.passwordFile": The file to read for username/password combinations (".htpasswd")
162
163
- "basicAuth.realm": Message shown when asking for credentials ("Username and password required")
163
164
- "firewall.reverseProxy": Set to "true" when a reverse proxy is used ("")
@@ -569,6 +570,12 @@ The above example will restrict access to the table 'license_keys' in all API ca
569
570
570
571
The above example will restrict access to the 'password' field from the 'users' table in all API calls.
571
572
573
+ 'authorization.recordHandler' => function ($method, $path, $databaseName, $tableName, $columnName) {
574
+ return ($tableName == 'users') ? 'filter=username,neq,admin' : '';
575
+ },
576
+
577
+ This will disallow viewing the user records where the username is 'admin'. It allows you to add a filter to every query.
578
+
572
579
### Sanitizing input
573
580
574
581
By default all input is accepted and sent to the database. If you want to strip (certain) HTML tags before storing you may add
0 commit comments