mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-28 12:05:21 +09:00
Cleaned Config
This commit is contained in:
18
config/expcore/command_auth_admin.lua
Normal file
18
config/expcore/command_auth_admin.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
--- This is a very simple config file which adds a admin only auth functio;
|
||||
-- not much to change here its more so it can be enabled and disabled from ./config/file_loader.lua;
|
||||
-- either way you can change the requirements to be "admin" if you wanted to
|
||||
-- @config Commands-Auth-Admin
|
||||
|
||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
||||
|
||||
Commands.add_authenticator(function(player,command,tags,reject)
|
||||
if tags.admin_only then
|
||||
if player.admin then
|
||||
return true
|
||||
else
|
||||
return reject{'command-auth.admin-only'}
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user