@@ -107,7 +107,7 @@ These features match features in v1 (see branch "v1"):
107107 - [ ] Supports file upload from web forms (multipart/form-data)
108108 - [ ] ~~ Condensed JSON output: first row contains field names~~
109109 - [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
111111 - [ ] Multi-tenant database layouts are supported
112112 - [x] Multi-domain CORS support for cross-domain requests
113113 - [x] Support for reading joined results from multiple tables
@@ -158,6 +158,7 @@ You can tune the middleware behavior using middleware specific configuration par
158158- "cors.maxAge": The time that the CORS grant is valid in seconds ("1728000")
159159- "authorization.tableHandler": Handler to implement table authorization rules ("")
160160- "authorization.columnHandler": Handler to implement column authorization rules ("")
161+ - "authorization.recordHandler": Handler to implement record authorization filter rules ("")
161162- "basicAuth.passwordFile": The file to read for username/password combinations (".htpasswd")
162163- "basicAuth.realm": Message shown when asking for credentials ("Username and password required")
163164- "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
569570
570571The above example will restrict access to the 'password' field from the 'users' table in all API calls.
571572
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+
572579### Sanitizing input
573580
574581By 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