mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Added Config
This commit is contained in:
@@ -1 +1,95 @@
|
||||
local Permission_Groups = require 'expcore.permission_groups'
|
||||
local Permission_Groups = require 'expcore.permission_groups'
|
||||
|
||||
Permission_Groups.new_group('admin')
|
||||
:allow_all()
|
||||
:disallow{
|
||||
'add_permission_group', -- admin
|
||||
'delete_permission_group',
|
||||
'edit_permission_group',
|
||||
'import_permissions_string',
|
||||
'map_editor_action',
|
||||
'toggle_map_editor',
|
||||
'change_multiplayer_config',
|
||||
'set_heat_interface_mode',
|
||||
'set_heat_interface_temperature',
|
||||
'set_infinity_container_filter_item',
|
||||
'set_infinity_container_remove_unfiltered_items',
|
||||
'set_infinity_pipe_filter'
|
||||
}
|
||||
|
||||
Permission_Groups.new_group('trusted')
|
||||
:allow_all()
|
||||
:disallow{
|
||||
'add_permission_group', -- admin
|
||||
'delete_permission_group',
|
||||
'edit_permission_group',
|
||||
'import_permissions_string',
|
||||
'map_editor_action',
|
||||
'toggle_map_editor',
|
||||
'change_multiplayer_config',
|
||||
'set_heat_interface_mode',
|
||||
'set_heat_interface_temperature',
|
||||
'set_infinity_container_filter_item',
|
||||
'set_infinity_container_remove_unfiltered_items',
|
||||
'set_infinity_pipe_filter',
|
||||
'admin_action' -- trusted
|
||||
}
|
||||
|
||||
Permission_Groups.new_group('standard')
|
||||
:allow_all()
|
||||
:disallow{
|
||||
'add_permission_group', -- admin
|
||||
'delete_permission_group',
|
||||
'edit_permission_group',
|
||||
'import_permissions_string',
|
||||
'map_editor_action',
|
||||
'toggle_map_editor',
|
||||
'change_multiplayer_config',
|
||||
'set_heat_interface_mode',
|
||||
'set_heat_interface_temperature',
|
||||
'set_infinity_container_filter_item',
|
||||
'set_infinity_container_remove_unfiltered_items',
|
||||
'set_infinity_pipe_filter',
|
||||
'admin_action', -- trusted
|
||||
'change_programmable_speaker_alert_parameters', -- standard
|
||||
'drop_item',
|
||||
'reset_assembling_machine',
|
||||
'set_auto_launch_rocket',
|
||||
'cancel_research'
|
||||
}
|
||||
|
||||
Permission_Groups.new_group('guest')
|
||||
:allow_all()
|
||||
:disallow{
|
||||
'add_permission_group', -- admin
|
||||
'delete_permission_group',
|
||||
'edit_permission_group',
|
||||
'import_permissions_string',
|
||||
'map_editor_action',
|
||||
'toggle_map_editor',
|
||||
'change_multiplayer_config',
|
||||
'set_heat_interface_mode',
|
||||
'set_heat_interface_temperature',
|
||||
'set_infinity_container_filter_item',
|
||||
'set_infinity_container_remove_unfiltered_items',
|
||||
'set_infinity_pipe_filter',
|
||||
'admin_action', -- trusted
|
||||
'change_programmable_speaker_alert_parameters', -- standard
|
||||
'drop_item',
|
||||
'reset_assembling_machine',
|
||||
'set_auto_launch_rocket',
|
||||
'cancel_research',
|
||||
'change_programmable_speaker_parameters', -- guest
|
||||
'change_train_stop_station',
|
||||
'deconstruct',
|
||||
'remove_cables',
|
||||
'remove_train_station',
|
||||
'reset_assembling_machine',
|
||||
'rotate_entity',
|
||||
'use_artillery_remote',
|
||||
'launch_rocket'
|
||||
}
|
||||
|
||||
Permission_Groups.new_group('restricted')
|
||||
:disallow_all()
|
||||
:allow('write_to_console')
|
||||
@@ -24,6 +24,7 @@ local files = {
|
||||
'modules.commands.cheat-mode',
|
||||
'modules.commands.interface',
|
||||
'modules.commands.help',
|
||||
'config.permission_groups'
|
||||
}
|
||||
|
||||
-- Loads all files in array above and logs progress
|
||||
|
||||
@@ -63,6 +63,9 @@ function Permissions_Groups.set_player_group(player,group)
|
||||
end
|
||||
|
||||
function Permissions_Groups._prototype:set_action(action,state)
|
||||
if type(action) == 'string' then
|
||||
action = defines.input_action[action]
|
||||
end
|
||||
self.actions[action] = state
|
||||
return self
|
||||
end
|
||||
@@ -98,6 +101,9 @@ function Permissions_Groups._prototype:disallow_all()
|
||||
end
|
||||
|
||||
function Permissions_Groups._prototype:is_allowed(action)
|
||||
if type(action) == 'string' then
|
||||
action = defines.input_action[action]
|
||||
end
|
||||
local state = self.actions[action]
|
||||
if state == nil then
|
||||
state = self.allow_all_actions
|
||||
|
||||
Reference in New Issue
Block a user