Compare commits
	
		
			2 Commits
		
	
	
		
			9f56d01b3e
			...
			14e859fd45
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 14e859fd45 | |
|  | 570aa63cc6 | 
|  | @ -2,6 +2,8 @@ | |||
| local acl = import("classes.acl") | ||||
| local command_acl = acl:extend("CommandACL") | ||||
| 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, | ||||
| --such as the role position | ||||
| function command_acl:check_group(roles) | ||||
|  | @ -34,7 +36,7 @@ end | |||
| function command_acl:check_perm(perms) | ||||
|    local output = true | ||||
|    for k,v in pairs(self.perm_rules) do | ||||
|      if not perms[v] then | ||||
|      if (bit.band(perms[1],enum_perms[v]) == 0) then | ||||
|        output = false | ||||
|      end | ||||
|    end | ||||
|  |  | |||
|  | @ -35,8 +35,8 @@ function command:__init(name,callback) | |||
|         self.rules:set_group_rule(k,v) | ||||
|       end | ||||
|     end | ||||
|     if callback.perm then | ||||
|       self.rules:set_perm_rules(callback.perm) | ||||
|     if callback.perms then | ||||
|       self.rules:set_perm_rules(callback.perms) | ||||
|     end | ||||
|     if callback.help then | ||||
|       self:set_help(callback.help,callback.usage) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue