Skip to content

Commit c3ec80b

Browse files
committed
Allow commands to be permissionless
1 parent 7c350ce commit c3ec80b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/command.js

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class Command {
1717
this.category = command.category;
1818
this.hidden = command.hidden || false;
1919

20+
this.permissionless = !!command.permissionless;
21+
2022
if (command.arguments) {
2123
this.arguments = command.arguments.map(arg => {
2224
if (arg instanceof argTypes.generic) {

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function parse(command, pass) {
105105

106106
let success = true;
107107

108-
if (argsObj.testPermission) {
108+
if (argsObj.testPermission && cmdSource.permissionless) {
109109
const cmdPerm = "commands." + (cmdSource.category ? cmdSource.category + "." : "") + cmdSource.originalName;
110110
if (!argsObj.testPermission(cmdPerm)) {
111111
success = false;

0 commit comments

Comments
 (0)