mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Debuged all functions
This commit is contained in:
11
config/command_auth_roles.lua
Normal file
11
config/command_auth_roles.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
--- This will make commands only work if the role has been allowed it in the role config
|
||||
local Commands = require 'expcore.commands'
|
||||
local Roles = require 'expcore.roles'
|
||||
|
||||
Commands.add_authenticator(function(player,command,tags,reject)
|
||||
if Roles.player_allowed(player,command) then
|
||||
return true
|
||||
else
|
||||
return reject()
|
||||
end
|
||||
end)
|
||||
@@ -24,6 +24,7 @@ return {
|
||||
'modules.addons.worn-paths',
|
||||
-- Config Files
|
||||
'config.command_auth_admin', -- commands tagged with admin_only are blocked for non admins
|
||||
'config.command_auth_roles', -- commands must be allowed via the role config
|
||||
'config.command_auth_runtime_disable', -- allows commands to be enabled and disabled during runtime
|
||||
'config.permission_groups', -- loads some predefined permission groups
|
||||
'config.roles', -- loads some predefined roles
|
||||
|
||||
@@ -17,21 +17,32 @@ end)
|
||||
|
||||
Roles.new_role('Server','SYS')
|
||||
:set_allow_all(true)
|
||||
:set_flag('admin',true)
|
||||
|
||||
Roles.new_role('Senior Admin','SAdmin')
|
||||
:set_allow_all(false)
|
||||
:set_flag('admin',true)
|
||||
:set_parent('Admin')
|
||||
:set_permission_group('Admin')
|
||||
:set_custom_color('blue')
|
||||
:allow{
|
||||
'interface'
|
||||
}
|
||||
|
||||
Roles.new_role('Admin','Admin')
|
||||
:set_flag('admin',true)
|
||||
:set_parent('Regular')
|
||||
:set_permission_group('Admin')
|
||||
:allow{
|
||||
'tp'
|
||||
}
|
||||
|
||||
Roles.new_role('Regular','Reg')
|
||||
:set_allow_all(false)
|
||||
:set_auto_promote_condition(playtime(5*minutes))
|
||||
:set_parent('Guest')
|
||||
:set_custom_tag('Reg')
|
||||
:set_permission_group('Trusted')
|
||||
|
||||
Roles.new_role('Guest','')
|
||||
:set_allow_all(false)
|
||||
:set_permission_group('Standard')
|
||||
|
||||
Roles.set_root('Server')
|
||||
@@ -40,5 +51,10 @@ Roles.set_default('Guest')
|
||||
Roles.define_role_order{
|
||||
'Server',
|
||||
'Senior Admin',
|
||||
'Regular',
|
||||
'Guest'
|
||||
}
|
||||
|
||||
Roles.override_player_roles{
|
||||
Cooldude2606={'Server','Senior Admin'}
|
||||
}
|
||||
Reference in New Issue
Block a user