Improving Data Separation and Management for Users and Citizens
Status: Implemented
Status: Implemented
Glossary
- User - An user account that can log into FiveNet.
- Citizen - A roleplay character that is optionally linked to an user account (e.g., might be "unlinked" if an user doesn't create a FiveNet account).
Problems
- Some servers that might have expanded the ESX framework or are even using a different framework, might have different ways to assign one or more groups to an user. This is currently not really supported.
- In case of ESX an user can only have one group assigned via the
userstablegroupcolumn. This also binds the permissions to the char itself and not to the whole "account."
- In case of ESX an user can only have one group assigned via the
- This continues for some other (common) data, e.g., jobs, phone numbers.
- Some chars might have more than one job, e.g., ModernV, people can have what you can call a "primary" job and a "secondary" job (technically even more), that are simply set in the
users. - Multiple phone numbers are also not supported, as ESX only supports one phone number per char which the current
fivenet_usertable is based on. There seems to be some phone plugins that allow multiple phone numbers.
- Some chars might have more than one job, e.g., ModernV, people can have what you can call a "primary" job and a "secondary" job (technically even more), that are simply set in the
- Sidenote: Being able to give an user superuser access or even allowing permissions to be given to users of a job and/or "globally."
Goals
- Citizens - Info/Data Changes
- Multiple Groups - Allowing multiple groups to be assigned to a citizen via DBSync from gameserver db and/or admin UI.
- Multiple Jobs - Allow multiple jobs to be assigned to a citizen via DBSync from gameserver db and/or admin UI.
- A clear distinction between primary and secondary jobs is needed.
- Multiple Phone Numbers - Allow multiple phone numbers to be assigned to a citizen.
- A clear distinction between primary and secondary phone numbers is needed.
- Creating/Editing/Deleting Citizens
- Creating a citizen with incomplete or all information should be possible manually via the admin UI
- Could be made accessible via permissions in the future for, e.g., hardcore roleplay servers that have staff manually "adding" new users via an airport.
- Ability to set citizen information based on permission levels.
- Ability to edit "citizens" in the FiveNet database (preferably with a way to reset back to "original" (from gameserver) state).
- Ability to delete "citizens" from the FiveNet database (without "deleting" them from the gameserver database).
- Creating a citizen with incomplete or all information should be possible manually via the admin UI
- Improve performance of account to citizens lookup by not having to use
WHEREidentifierLIKE '%_IDENTIFIER_HERE_'queries.- An
userentry will be linked to the account ID directly instead of having to search for it via the identifier pattern matching.
- An
Solutions
- Changing the
fivenet_usertable structure.- Adding a
deleted_atcolumn to be able to soft-delete users, with adeleted_reasonfield. - The current "singular" columns (
group,job, andphone_number) will be kept as they are, a prefix ofactive_orprimary_might be added to clarify their purpose. - Adding new (plural named) columns for
groups,jobs, andphone_numbersthat are of typeJSONorLONGTEXT(required for compatibility with MariaDB).- Or even seperate tables for each of them, e.g.,
fivenet_user_groups,fivenet_user_jobs,fivenet_user_phone_numbers.- These tables would have a foreign key to the
fivenet_usertable and store multiple entries per user.
- These tables would have a foreign key to the
- Or even seperate tables for each of them, e.g.,
- Adding a
- Updating the FiveNet admin UI to support the new functionalities.
- Adding interfaces for managing multiple groups, jobs, and phone numbers.
- Adding interfaces for creating, editing, and deleting "citizens."
