mirror of
https://github.com/LBRYFoundation/curate.git
synced 2025-08-23 17:37:25 +00:00
Update permissions
This commit is contained in:
parent
864d840144
commit
1442216bc3
10 changed files with 13 additions and 15 deletions
|
@ -51,15 +51,13 @@ export function rolePermissionCheck(...roles: (string | string[])[]) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
client.permissions.register('lbry.curator', rolePermissionCheck(client.config.curatorRoles));
|
|
||||||
client.permissions.register('lbry.trusted', rolePermissionCheck(client.config.trustedRoles));
|
|
||||||
client.permissions.register('lbry.admin', rolePermissionCheck(client.config.adminRoles));
|
client.permissions.register('lbry.admin', rolePermissionCheck(client.config.adminRoles));
|
||||||
client.permissions.register(
|
client.permissions.register(
|
||||||
'lbry.curatorOrAdmin',
|
'lbry.curator',
|
||||||
rolePermissionCheck(client.config.curatorRoles, client.config.adminRoles)
|
rolePermissionCheck(client.config.curatorRoles, client.config.adminRoles)
|
||||||
);
|
);
|
||||||
client.permissions.register(
|
client.permissions.register(
|
||||||
'lbry.trustedOrAdmin',
|
'lbry.trusted',
|
||||||
rolePermissionCheck(client.config.trustedRoles, client.config.adminRoles)
|
rolePermissionCheck(client.config.trustedRoles, client.config.adminRoles)
|
||||||
);
|
);
|
||||||
/* #endregion */
|
/* #endregion */
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default class AbandonCommand extends GeneralCommand {
|
||||||
description: 'Abandon a support on a claim.',
|
description: 'Abandon a support on a claim.',
|
||||||
category: 'Curator',
|
category: 'Curator',
|
||||||
aliases: ['aban', 'drop'],
|
aliases: ['aban', 'drop'],
|
||||||
userPermissions: ['lbry.curatorOrAdmin'],
|
userPermissions: ['lbry.curator'],
|
||||||
metadata: {
|
metadata: {
|
||||||
examples: ['abandon @channel#a/video#b'],
|
examples: ['abandon @channel#a/video#b'],
|
||||||
usage: '<claim>'
|
usage: '<claim>'
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default class BalanceCommand extends GeneralCommand {
|
||||||
description: 'Shows your account balance.',
|
description: 'Shows your account balance.',
|
||||||
category: 'Curator',
|
category: 'Curator',
|
||||||
aliases: ['bal'],
|
aliases: ['bal'],
|
||||||
userPermissions: ['lbry.curatorOrAdmin'],
|
userPermissions: ['lbry.curator'],
|
||||||
metadata: {
|
metadata: {
|
||||||
examples: ['balance', 'balance @user'],
|
examples: ['balance', 'balance @user'],
|
||||||
usage: '<user>',
|
usage: '<user>',
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default class SupportCommand extends GeneralCommand {
|
||||||
description: 'Support a claim.',
|
description: 'Support a claim.',
|
||||||
category: 'Curator',
|
category: 'Curator',
|
||||||
aliases: ['sup'],
|
aliases: ['sup'],
|
||||||
userPermissions: ['lbry.curatorOrAdmin'],
|
userPermissions: ['lbry.curator'],
|
||||||
metadata: {
|
metadata: {
|
||||||
examples: ['support @channel#a/video#b 2.0'],
|
examples: ['support @channel#a/video#b 2.0'],
|
||||||
usage: '<claim> <amount>'
|
usage: '<claim> <amount>'
|
||||||
|
|
|
@ -11,7 +11,7 @@ export default class SupportsCommand extends GeneralCommand {
|
||||||
description: 'List supports.',
|
description: 'List supports.',
|
||||||
category: 'Curator',
|
category: 'Curator',
|
||||||
aliases: ['sups'],
|
aliases: ['sups'],
|
||||||
userPermissions: ['lbry.curatorOrAdmin'],
|
userPermissions: ['lbry.curator'],
|
||||||
metadata: {
|
metadata: {
|
||||||
examples: ['supports', 'supports @user', 'supports @user @channel#a/video#b'],
|
examples: ['supports', 'supports @user', 'supports @user @channel#a/video#b'],
|
||||||
usage: '[user] [claim]'
|
usage: '[user] [claim]'
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default class TAbandonCommand extends GeneralCommand {
|
||||||
description: 'Abandon a support on a claim from the trusted account.',
|
description: 'Abandon a support on a claim from the trusted account.',
|
||||||
category: 'Trusted',
|
category: 'Trusted',
|
||||||
aliases: ['taban', 'tdrop'],
|
aliases: ['taban', 'tdrop'],
|
||||||
userPermissions: ['lbry.trustedOrAdmin'],
|
userPermissions: ['lbry.trusted'],
|
||||||
metadata: {
|
metadata: {
|
||||||
examples: ['tabandon @channel#a/video#b'],
|
examples: ['tabandon @channel#a/video#b'],
|
||||||
usage: '<claim>'
|
usage: '<claim>'
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default class TBalanceCommand extends GeneralCommand {
|
||||||
description: 'Shows the trusted account balance.',
|
description: 'Shows the trusted account balance.',
|
||||||
category: 'Trusted',
|
category: 'Trusted',
|
||||||
aliases: ['tbal'],
|
aliases: ['tbal'],
|
||||||
userPermissions: ['lbry.trustedOrAdmin'],
|
userPermissions: ['lbry.trusted'],
|
||||||
metadata: {
|
metadata: {
|
||||||
examples: ['tbalance']
|
examples: ['tbalance']
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default class TSupportCommand extends GeneralCommand {
|
||||||
description: 'Support a claim from the trusted account.',
|
description: 'Support a claim from the trusted account.',
|
||||||
category: 'Trusted',
|
category: 'Trusted',
|
||||||
aliases: ['tsup'],
|
aliases: ['tsup'],
|
||||||
userPermissions: ['lbry.trustedOrAdmin'],
|
userPermissions: ['lbry.trusted'],
|
||||||
metadata: {
|
metadata: {
|
||||||
examples: ['tsupport @channel#a/video#b 2.0'],
|
examples: ['tsupport @channel#a/video#b 2.0'],
|
||||||
usage: '<claim> <amount>'
|
usage: '<claim> <amount>'
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default class TSupportsCommand extends GeneralCommand {
|
||||||
description: 'List supports from the trusted account.',
|
description: 'List supports from the trusted account.',
|
||||||
category: 'Trusted',
|
category: 'Trusted',
|
||||||
aliases: ['tsups'],
|
aliases: ['tsups'],
|
||||||
userPermissions: ['lbry.trustedOrAdmin'],
|
userPermissions: ['lbry.trusted'],
|
||||||
metadata: {
|
metadata: {
|
||||||
examples: ['tsupports @channel#a/video#b'],
|
examples: ['tsupports @channel#a/video#b'],
|
||||||
usage: '[claim]'
|
usage: '[claim]'
|
||||||
|
|
|
@ -76,10 +76,10 @@ export abstract class GeneralCommand extends DexareCommand {
|
||||||
if (missing.length > 0) {
|
if (missing.length > 0) {
|
||||||
if (missing.includes('dexare.elevated'))
|
if (missing.includes('dexare.elevated'))
|
||||||
return `The \`${this.name}\` command can only be used by the bot developers or elevated users.`;
|
return `The \`${this.name}\` command can only be used by the bot developers or elevated users.`;
|
||||||
else if (missing.includes('lbry.curator') || missing.includes('lbry.curatorOrAdmin'))
|
else if (missing.includes('lbry.curator'))
|
||||||
return `The \`${this.name}\` command can only be ran by LBRY curators.`;
|
return `The \`${this.name}\` command can only be ran by LBRY curators.`;
|
||||||
else if (missing.includes('lbry.trusted') || missing.includes('lbry.trustedOrAdmin'))
|
else if (missing.includes('lbry.trusted'))
|
||||||
return `The \`${this.name}\` command can only be ran by LBRY trusteds.`;
|
return `The \`${this.name}\` command can only be ran by Trusted account users.`;
|
||||||
else if (missing.includes('lbry.admin'))
|
else if (missing.includes('lbry.admin'))
|
||||||
return `The \`${this.name}\` command can only be ran by LBRY admins.`;
|
return `The \`${this.name}\` command can only be ran by LBRY admins.`;
|
||||||
else if (missing.includes('dexare.nsfwchannel'))
|
else if (missing.includes('dexare.nsfwchannel'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue