Skip to content

Commit

Permalink
Merge pull request #29 from intelequia/superusers
Browse files Browse the repository at this point in the history
Added SuperUsers role for RLS
  • Loading branch information
davidjrh authored Nov 5, 2023
2 parents 7f0ca39 + 91a786b commit 2671a37
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/images/ReleaseBadge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/DotNetNuke.PowerBI/Components/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public class Common
public static UserInfo CurrentUser => UserController.Instance.GetCurrentUserInfo();

public static bool IsSuperUser()
{
{
// Usuario no logueado
if (CurrentUser.UserID == -1)
if (CurrentUser == null || CurrentUser.UserID == -1)
return false;

return CurrentUser.IsSuperUser;
Expand Down
6 changes: 3 additions & 3 deletions src/DotNetNuke.PowerBI/DotNetNuke.PowerBI.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="PowerBIEmbeddedList" type="Module" version="01.02.01">
<package name="PowerBIEmbeddedList" type="Module" version="01.02.02">
<friendlyName>PowerBI Embedded Content List</friendlyName>
<description>A set of modules to embed PowerBI Embedded dashboards and reports into a DNN Platform installation.</description>
<iconFile>~/DesktopModules/MVC/PowerBIEmbedded/images/powerbi.png</iconFile>
Expand Down Expand Up @@ -176,7 +176,7 @@
</component>
</components>
</package>
<package name="PowerBIEmbeddedContent" type="Module" version="01.02.01">
<package name="PowerBIEmbeddedContent" type="Module" version="01.02.02">
<friendlyName>PowerBI Embedded Content View</friendlyName>
<description>A set of modules to embed PowerBI Embedded dashboards and reports into a DNN Platform installation.</description>
<iconFile>~/DesktopModules/MVC/PowerBIEmbedded/images/powerbi.png</iconFile>
Expand Down Expand Up @@ -231,7 +231,7 @@
</component>
</components>
</package>
<package name="PowerBIEmbeddedCalendar" type="Module" version="01.02.01">
<package name="PowerBIEmbeddedCalendar" type="Module" version="01.02.02">
<friendlyName>PowerBI Embedded Calendar View</friendlyName>
<description>A set of modules to embed PowerBI Embedded dashboards and reports into a DNN Platform installation.</description>
<iconFile>~/DesktopModules/MVC/PowerBIEmbedded/images/powerbi.png</iconFile>
Expand Down
4 changes: 2 additions & 2 deletions src/DotNetNuke.PowerBI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("01.02.01.*")]
[assembly: AssemblyVersion("01.02.02.*")]
#pragma warning disable CS7035 // The specified version string does not conform to the recommended format - major.minor.build.revision
[assembly: AssemblyFileVersion("01.02.01.*")]
[assembly: AssemblyFileVersion("01.02.02.*")]
#pragma warning restore CS7035 // The specified version string does not conform to the recommended format - major.minor.build.revision
4 changes: 4 additions & 0 deletions src/DotNetNuke.PowerBI/Services/EmbedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,10 @@ public async Task<EmbedConfig> GetDashboardEmbedConfigAsync(int userId, string u
rolesList.AddRange(roles.Split(','));
rls.Roles = rolesList;
}
if (Components.Common.IsSuperUser())
{
rls.Roles.Add("SuperUsers");
}
// Generate Embed Token with effective identities.
generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: permission, identities: new List<EffectiveIdentity> { rls });
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 2671a37

Please sign in to comment.