-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added IPermissionDefinitionService for Abstractions Project #5841
Added IPermissionDefinitionService for Abstractions Project #5841
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing sticks out to me. Just no in love with IPermissionInfoBase name which makes it look like a base class. What about we use IPermission and IPermissionInfo instead of IPermissionInfo and IPermissionInfoBase ? Just a thought...
The only downside to IPermission is that it's an already existing interface in .NET Framework: System.Security.IPermission. We can also merge the two interfaces to a single interface |
Sounds good. Hey what tool you use for that graph ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
DNN Platform/Library/Security/Permissions/PermissionController.cs
Outdated
Show resolved
Hide resolved
DNN Platform/Library/Security/Permissions/PermissionController.cs
Outdated
Show resolved
Hide resolved
I agree, let's merge |
Sadly, I couldn't merge PermissionInfo is from I've renamed Is this OK? |
Sounds great to me, thanks! |
2d18572
to
94327db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, given this is the resource manager and not part of any distributed nuget package I am not worried about the breaking changes in this.
I've checked |
I'm still thinking about the interface name. If we're gonna make abstractions for Another solution is to rename this interface to |
I think |
There are still 2 comments open: #5841 (comment), #5841 (comment); other than that everything is done. |
Thanks @GerardSmit, this is looking great. The @dnnsoftware/approvers will meet next Tuesday, so we may not get a definitive answer on those open questions until then. We appreciate your contribution and your patience. |
Fixes dnnsoftware#5840 Co-authored-by: Brian Dukes <[email protected]>
Dnn.Modules.ResourceManager has TreatWarningsAsErrors enabled
397ffaf
to
83a6890
Compare
@dnnsoftware/approvers I've rebased on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, great work!
Fixes #5840
Summary
This PR adds
IPermissionDefinitionService
which is an abstraction layer forPermissionController
.Instead of returning an ArrayList in the
GetPermissions*
-methods, I've made the return typeIEnumerable<IPermissionInfo>
; this reduces allocations (ArrayList instance and two arrays). For all these methods I've created an Enumerable method, that's being used by the current implementation and interface implementation; this is so we don't have duplicated code.I've only created an interface for this class. All calls to the PermissionController haven't been refactored.
TODO
IPermissionInfoBase
andIPermissionInfo
into a single interfaceIPermissionInfo