Update permissions

This commit is contained in:
Snazzah 2021-06-25 11:35:57 -05:00
parent 864d840144
commit 1442216bc3
No known key found for this signature in database
GPG key ID: 5E71D54F3D86282E
10 changed files with 13 additions and 15 deletions

View file

@ -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.curatorOrAdmin',
'lbry.curator',
rolePermissionCheck(client.config.curatorRoles, client.config.adminRoles)
);
client.permissions.register(
'lbry.trustedOrAdmin',
'lbry.trusted',
rolePermissionCheck(client.config.trustedRoles, client.config.adminRoles)
);
/* #endregion */

View file

@ -9,7 +9,7 @@ export default class AbandonCommand extends GeneralCommand {
description: 'Abandon a support on a claim.',
category: 'Curator',
aliases: ['aban', 'drop'],
userPermissions: ['lbry.curatorOrAdmin'],
userPermissions: ['lbry.curator'],
metadata: {
examples: ['abandon @channel#a/video#b'],
usage: '<claim>'

View file

@ -10,7 +10,7 @@ export default class BalanceCommand extends GeneralCommand {
description: 'Shows your account balance.',
category: 'Curator',
aliases: ['bal'],
userPermissions: ['lbry.curatorOrAdmin'],
userPermissions: ['lbry.curator'],
metadata: {
examples: ['balance', 'balance @user'],
usage: '<user>',

View file

@ -10,7 +10,7 @@ export default class SupportCommand extends GeneralCommand {
description: 'Support a claim.',
category: 'Curator',
aliases: ['sup'],
userPermissions: ['lbry.curatorOrAdmin'],
userPermissions: ['lbry.curator'],
metadata: {
examples: ['support @channel#a/video#b 2.0'],
usage: '<claim> <amount>'

View file

@ -11,7 +11,7 @@ export default class SupportsCommand extends GeneralCommand {
description: 'List supports.',
category: 'Curator',
aliases: ['sups'],
userPermissions: ['lbry.curatorOrAdmin'],
userPermissions: ['lbry.curator'],
metadata: {
examples: ['supports', 'supports @user', 'supports @user @channel#a/video#b'],
usage: '[user] [claim]'

View file

@ -10,7 +10,7 @@ export default class TAbandonCommand extends GeneralCommand {
description: 'Abandon a support on a claim from the trusted account.',
category: 'Trusted',
aliases: ['taban', 'tdrop'],
userPermissions: ['lbry.trustedOrAdmin'],
userPermissions: ['lbry.trusted'],
metadata: {
examples: ['tabandon @channel#a/video#b'],
usage: '<claim>'

View file

@ -8,7 +8,7 @@ export default class TBalanceCommand extends GeneralCommand {
description: 'Shows the trusted account balance.',
category: 'Trusted',
aliases: ['tbal'],
userPermissions: ['lbry.trustedOrAdmin'],
userPermissions: ['lbry.trusted'],
metadata: {
examples: ['tbalance']
}

View file

@ -10,7 +10,7 @@ export default class TSupportCommand extends GeneralCommand {
description: 'Support a claim from the trusted account.',
category: 'Trusted',
aliases: ['tsup'],
userPermissions: ['lbry.trustedOrAdmin'],
userPermissions: ['lbry.trusted'],
metadata: {
examples: ['tsupport @channel#a/video#b 2.0'],
usage: '<claim> <amount>'

View file

@ -9,7 +9,7 @@ export default class TSupportsCommand extends GeneralCommand {
description: 'List supports from the trusted account.',
category: 'Trusted',
aliases: ['tsups'],
userPermissions: ['lbry.trustedOrAdmin'],
userPermissions: ['lbry.trusted'],
metadata: {
examples: ['tsupports @channel#a/video#b'],
usage: '[claim]'

View file

@ -76,10 +76,10 @@ export abstract class GeneralCommand extends DexareCommand {
if (missing.length > 0) {
if (missing.includes('dexare.elevated'))
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.`;
else if (missing.includes('lbry.trusted') || missing.includes('lbry.trustedOrAdmin'))
return `The \`${this.name}\` command can only be ran by LBRY trusteds.`;
else if (missing.includes('lbry.trusted'))
return `The \`${this.name}\` command can only be ran by Trusted account users.`;
else if (missing.includes('lbry.admin'))
return `The \`${this.name}\` command can only be ran by LBRY admins.`;
else if (missing.includes('dexare.nsfwchannel'))