Compare commits

..

No commits in common. "14e859fd45281226ece45589ea35951b7f273349" and "9f56d01b3ed9942c9be32483bae996267e95eb8f" have entirely different histories.

2 changed files with 3 additions and 5 deletions

View File

@ -2,8 +2,6 @@
local acl = import("classes.acl") local acl = import("classes.acl")
local command_acl = acl:extend("CommandACL") local command_acl = acl:extend("CommandACL")
local table_utils = import("table-utils") local table_utils = import("table-utils")
local discordia = import("discordia")
local enum_perms = discordia.enums.permission
--The following method extends the ACL class to work with rule-specific features, --The following method extends the ACL class to work with rule-specific features,
--such as the role position --such as the role position
function command_acl:check_group(roles) function command_acl:check_group(roles)
@ -36,7 +34,7 @@ end
function command_acl:check_perm(perms) function command_acl:check_perm(perms)
local output = true local output = true
for k,v in pairs(self.perm_rules) do for k,v in pairs(self.perm_rules) do
if (bit.band(perms[1],enum_perms[v]) == 0) then if not perms[v] then
output = false output = false
end end
end end

View File

@ -35,8 +35,8 @@ function command:__init(name,callback)
self.rules:set_group_rule(k,v) self.rules:set_group_rule(k,v)
end end
end end
if callback.perms then if callback.perm then
self.rules:set_perm_rules(callback.perms) self.rules:set_perm_rules(callback.perm)
end end
if callback.help then if callback.help then
self:set_help(callback.help,callback.usage) self:set_help(callback.help,callback.usage)