Hi
I'm pretty new to DNN so this may be the wrong place for this post
and I may be doing things wrong, but...
The GetUserRole method on DotNetNuke.Security.Roles.RoleController
returns a UserRoleInfo which is full populated (Exactly as I would
expect it to look).
However the GetUserRoles returns an array of UserRoleInfo objects
that are partially populated. Which seems wrong and not what I want,
as I need the information that is missing.
Looking at the 2 code, the calls go through the same mechanisum,
the only real difference being the store procs.
the GetUserRole proc looks like this
SELECT r.*,
ur.UserRoleID,
ur.UserID,
ur.EffectiveDate,
ur.ExpiryDate,
ur.IsTrialUsed
FROM UserRoles ur
INNER JOIN UserPortals up on ur.UserId = up.UserId
INNER JOIN Roles r on r.RoleID = ur.RoleID
....
The GetUserRoles looks like this
SELECT
UR.UserRoleID,
U.UserID,
U.DisplayName,
U.Email,
UR.EffectiveDate,
UR.ExpiryDate,
UR.IsTrialUsed
FROM UserRoles UR
INNER JOIN Users U ON UR.UserID = U.UserID
INNER JOIN Roles R ON UR.RoleID = R.RoleID
IF I change it to this
SELECT
r.*, -- ADDED THIS TO Match GetUserRole
UR.UserRoleID,
U.UserID,
U.DisplayName,
U.Email,
UR.EffectiveDate,
UR.ExpiryDate,
UR.IsTrialUsed
FROM UserRoles UR
INNER JOIN Users U ON UR.UserID = U.UserID
INNER JOIN Roles R ON UR.RoleID = R.RoleID
then everything seems to work fine.
Is this a change I can safley make, and should it
be rolled into the main code base?
Also Why is there no caching on the user roles,
this strikes me as an area the would benefit
significantly from a bit of caching (maybe
im just using the wrong objects?)
For reference.
DotNetNuke.Security.Roles.RoleController ends up calling the
DNNRoleProvider:-
Public Overrides Function GetUserRole(
ByVal portalId As Integer,
ByVal userId As Integer,
ByVal roleId As Integer) As UserRoleInfo
Return CType(CBO.FillObject(
dataProvider.GetUserRole(portalId, userId, roleId),
GetType(UserRoleInfo)), UserRoleInfo)
End Function
Public Overloads Overrides Function GetUserRoles(
ByVal portalId As Integer,
ByVal userId As Integer,
ByVal includePrivate As Boolean) As ArrayList
If includePrivate Then
Return CBO.FillCollection(
dataProvider.GetUserRoles(portalId, userId),
GetType(UserRoleInfo))
Else
Return CBO.FillCollection(
dataProvider.GetServices(portalId, userId),
GetType(UserRoleInfo))
End If
End Function
|