ps-mdt icon indicating copy to clipboard operation
ps-mdt copied to clipboard

Add ability to limit access to the MDT by job and grade level

Open BackSH00TER opened this issue 10 months ago • 0 comments

This pull request includes changes to enhance the permission check system for accessing the MDT by including a minimum grade requirement.

  • server/utils.lua: Updated the PermCheck function to include a check for the minimum grade required for accessing the MDT. The function now verifies if the user's job and grade meet the required criteria.

  • shared/config.lua Updated the Config.PoliceJobs, Config.AmbulanceJobs, and Config.DojJobs to include a minGradeRequired field, allowing for more granular control over access permissions based on job grade.

  • A value of 0 gives access to all grade levels for that job.

Example:

['lawyer'] = true,  =>  ['lawyer'] = { minGradeRequired = 2 },
['judge'] = true,  => ['judge'] = {  minGradeRequired = 0 },

Why is this needed? Currently the MDT checks the players job to see whether they can access the MDT. This is just checking that their job name matches. Some servers want to be able to limit access to the MDT by job name + grade level. For example, a server might want to configure the 'lawyer' job to only have access to the MDT if they are grade level 2 or higher.

BackSH00TER avatar Mar 29 '25 22:03 BackSH00TER