Permission based view on server settings #1482
Open
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.
Summary
The server settings view was getting destroyed when you're not an admin and was obviously not readded after the permission is automatically added, leaving the whole panel empty on the first run of the game in the editor.
To fix this, rather than destroying the object we're gracefully handling the lack of permissions with a separate view that just says permission denied. The code for the button now checks permissions too for completeness sake.
The new behaviour that enables or disables objects based on permission is intended for UI use and simply has a list of permissions and their associated objects. All matching permission's objects are enabled, the default is disabled. If no permissions match, the default is enabled.
PR checklist
Pictures/Videos
Testing
Changes
Related issues/PRs