Example usage of DotNetNuke.Security.Permissions.PermissionController.RemapPermission()
Add an Answer
Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
I'm trying to implement some custom cross-portal module sharing, where permissions are mapped to roles and then their correct ids. I think I've found a method that can do it, but there's no documentation on this method, and the generics are a bit confusing to me.
When I try to
var origPermissionInfo = permissionController.GetPermission(originPermission.PermissionID);
var permissionInfo = permissionController.RemapPermission(origPermissionInfo, destinationPortal);
I get this.
The type 'DotNetNuke.Security.Permissons.PermissionInfo' must be convertible to 'DotNetNuke.Security.Permissions.PermissionInfoBase' in order to use it as parameter 'T' in the generic method 'T DotNetNuke.Security.Permissons.PermissionController.RemapPermission(T, int)'
or
var origPermissionInfo = permissionController.GetPermission(originPermission.PermissionID);
var permissionInfo = permissionController.RemapPermission(origPermissionInfo, destinationPortal);
becomes
Argument type 'DotNetNuke.Security.Permissons.PermissionInfo' is not assignable to parameter type DotNetNuke.Security.Permissons.PermissionInfoBase'
Any help would be appreciated!