Add canCreateChannel role policy to control channel creation
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
parent
b383bf9848
commit
d4c2d840d7
|
|
@ -47,6 +47,7 @@ export type RolePolicies = {
|
|||
canSearchUsers: boolean;
|
||||
canUseTranslator: boolean;
|
||||
canHideAds: boolean;
|
||||
canCreateChannel: boolean;
|
||||
driveCapacityMb: number;
|
||||
maxFileSizeMb: number;
|
||||
alwaysMarkNsfw: boolean;
|
||||
|
|
@ -88,6 +89,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
|
|||
canSearchUsers: true,
|
||||
canUseTranslator: true,
|
||||
canHideAds: false,
|
||||
canCreateChannel: true,
|
||||
driveCapacityMb: 100,
|
||||
maxFileSizeMb: 30,
|
||||
alwaysMarkNsfw: false,
|
||||
|
|
|
|||
|
|
@ -224,6 +224,10 @@ export const packedRolePoliciesSchema = {
|
|||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
canCreateChannel: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
driveCapacityMb: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ export const meta = {
|
|||
|
||||
kind: 'write:channels',
|
||||
|
||||
requiredRolePolicy: 'canCreateChannel',
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 10,
|
||||
|
|
|
|||
Loading…
Reference in New Issue