Use update permissions explicitly

This commit is contained in:
rijkvanzanten
2020-08-21 12:14:09 -06:00
parent 1ccf1b0ada
commit 1ba8577a38

View File

@@ -29,7 +29,15 @@ export default class UtilsService {
}
if (this.accountability?.admin !== true) {
const permissions = await this.knex.select('fields').from('directus_permissions').where({ role: this.accountability?.role || null, collection }).first();
const permissions = await this.knex
.select('fields')
.from('directus_permissions')
.where({
collection,
operation: 'update',
role: this.accountability?.role || null,
})
.first();
if (!permissions) {
throw new ForbiddenException();