Add a NewUser role with separate perms, minor restricted role handling improvements#1106
Open
Toastbrot236 wants to merge 17 commits into
Open
Add a NewUser role with separate perms, minor restricted role handling improvements#1106Toastbrot236 wants to merge 17 commits into
Toastbrot236 wants to merge 17 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
NewUserrole toGameUserRolewhich is inbetweenUserandRestricted. Newly created accounts will have their role set toNewUserinstead ofUser. New users have their own, separate role-perms inrefreshGameServer.json, and said config now also has anHoursUntilNewAccountNoLongerNewoption, which defines how old an account must be in order to be automatically promoted from new user to normal user. This automatic promotion is done byNewUserJob.This closes #1098.
Additionally, this PR also does the following:
RestrictedandBannedroles if requested (normallyRoleServicealready takes care of blocking upload requests by such users, but this is just a fallback incase the service fails, also useful incase we add other things which need role-perms, and this generally makes the methods simpler). I've added this in this PR because I already had to edit the methods to handle new user perms.TimeProvidertoWorkContextso we could easily modify the current time there to test theNewUserJob. This doesn't make other jobs, which also use current time (likeCoolLevelsJobandDiscordIntegrationJob), use the time provider yet though. That should be done and tested in another PR.Also, this PR still needs unit tests for the new config migrations, and manual testing on a real Refresh instance.