mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
fix directus_user mutation with role (#12849)
This commit is contained in:
@@ -167,7 +167,10 @@ export class UsersService extends ItemsService {
|
||||
*/
|
||||
async updateMany(keys: PrimaryKey[], data: Partial<Item>, opts?: MutationOptions): Promise<PrimaryKey[]> {
|
||||
if (data.role) {
|
||||
const newRole = await this.knex.select('admin_access').from('directus_roles').where('id', data.role).first();
|
||||
// data.role will be an object with id with GraphQL mutations
|
||||
const roleId = data.role?.id ?? data.role;
|
||||
|
||||
const newRole = await this.knex.select('admin_access').from('directus_roles').where('id', roleId).first();
|
||||
|
||||
if (!newRole?.admin_access) {
|
||||
await this.checkRemainingAdminExistence(keys);
|
||||
|
||||
Reference in New Issue
Block a user