PermissionsManager and DefaultPermissionsProvider improvements#425
Open
OMEGA3065 wants to merge 3 commits into
Open
PermissionsManager and DefaultPermissionsProvider improvements#425OMEGA3065 wants to merge 3 commits into
OMEGA3065 wants to merge 3 commits into
Conversation
Contributor
Author
|
I might respond faster if receive a ping in the discord: <@799984967227670529> |
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.
Provides new methods which can be used to interact with the PermissionManager and DefaultPermissionsProvider in more ways without the need for publicizing the assembly.
This PR was made because of a suggestion: #424
The changes made to the PermissionManager are mostly QoL with 1 exception.
List of changes:
RegisterProvider<T>usingActivator.CreateInstanceeven though the type argument was specified as supporting a parameterless constructor. Modified code so instead of usingActivator.CreateInstance<T>()it usesnew T().GetProvider(Type type)which allows to get a provider even if we only have it's type object (runtime) as provided byGetPermissionsByProviderTryGetProvider<T>(out provider) -> Twhich allows the caller to automatically have the returned type be the type provided as an argument.The changes made to the DefaultPermissionsProvider allow for more interaction concerning obtainging full lists of permissions provided by a UserGroup and allowing for runtime registration of .
List of changes:
RegisterProvider<T>usingActivator.CreateInstanceeven though the type argument was specified as supporting a parameterless constructor. Modified code so instead of usingActivator.CreateInstance<T>()it usesnew T().GetProvider(Type type)which allows to get a provider even if we only have it's type object (runtime) as provided byGetPermissionsByProviderTryGetProvider<T>(out provider) -> Twhich allows the caller to automatically have the returned type be the type provided as an argument.GetPlayerGroupwas made publicGetPermissionGroupwas added to allow the caller obtain thePermissionGroupbased on a string UserGroup registry name.GetPermissionswas made publicAddPermissionGroupwas added to allow the caller to add / override existing groups.RemovePermissionGroupsame reason as AddPermissionGroup` but for removal of groups.