[IMPROVE] Add default permission 'start-discussion' and 'start-discussion-other-user' to app user (#22577)
Co-authored-by: Diego Sampaio <chinello@gmail.com>pull/23016/head
parent
46e0c4c771
commit
0c75472daf
@ -0,0 +1,8 @@ |
||||
export declare const Migrations: { |
||||
add(migration: { |
||||
version: number; |
||||
name?: string; |
||||
up: () => void; |
||||
down?: () => void; |
||||
}): void; |
||||
}; |
@ -0,0 +1,12 @@ |
||||
import { Migrations } from '../../../app/migrations/server'; |
||||
import { Permissions } from '../../../app/models/server'; |
||||
|
||||
const roleName = 'app'; |
||||
|
||||
Migrations.add({ |
||||
version: 230, |
||||
up() { |
||||
Permissions.update({ _id: 'start-discussion' }, { $addToSet: { roles: roleName } }); |
||||
Permissions.update({ _id: 'start-discussion-other-user' }, { $addToSet: { roles: roleName } }); |
||||
}, |
||||
}); |
Loading…
Reference in new issue