diff --git a/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.cshtml b/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.cshtml index bb5755c38..9b86a080f 100644 --- a/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.cshtml +++ b/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.cshtml @@ -19,10 +19,16 @@ int rowCount = 1; int maxDepth = Model.PermissionRoleMatrix.Max(item => item.Depth); int headerLevel = maxDepth + 1; + + var roleHeaders = Model.PermissionRoleMatrix.FirstOrDefault()?.RolePermissions.Keys ?? Enumerable.Empty(); + var filteredPermissions = Model.ShowNotDefined + ? Model.PermissionRoleMatrix.Where(p => !p.IsDefined) + : Model.PermissionRoleMatrix.Where(p => p.IsDefined); } @section scripts { + } @section styles { @@ -72,14 +78,14 @@ Permission Group Permission Description - @foreach (var role in Model.PermissionRoleMatrix.FirstOrDefault()?.RolePermissions.Keys ?? Enumerable.Empty()) + @foreach (var role in roleHeaders) { @role } - @foreach (var permission in Model.PermissionRoleMatrix) + @foreach (var permission in filteredPermissions) { @rowCount.ToString("D2") @@ -107,7 +113,7 @@ Permission Group Permission Description - @foreach (var role in Model.PermissionRoleMatrix.FirstOrDefault()?.RolePermissions.Keys ?? Enumerable.Empty()) + @foreach (var role in roleHeaders) { @role } @@ -120,7 +126,7 @@ - @foreach (var permission in Model.PermissionRoleMatrix) + @foreach (var permission in filteredPermissions) { diff --git a/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.cshtml.cs b/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.cshtml.cs index 9faecdfb6..6a7ed8a91 100644 --- a/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.cshtml.cs +++ b/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.cshtml.cs @@ -4,30 +4,44 @@ using System.Threading.Tasks; using Unity.GrantManager.Repositories; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; namespace Unity.GrantManager.Web.Pages.Identity.Roles; -public class PermissionRoleMatrixModel(IPermissionRoleMatrixRepository repository) : AbpPageModel +public class PermissionRoleMatrixModel(IPermissionRoleMatrixRepository repository, IPermissionDefinitionManager permissionDefinitionManager) : AbpPageModel { public bool IsExpanded { get; private set; } + public bool ShowNotDefined { get; private set; } = false; public required IList PermissionRoleMatrix { get; set; } public async Task OnGetAsync() { // Check if the query parameter "Render" is set to "Expanded" IsExpanded = Request.Query["Render"].ToString().Equals("Expanded", StringComparison.OrdinalIgnoreCase); + ShowNotDefined = Request.Query["Show"].ToString().Equals("NotDefined", StringComparison.OrdinalIgnoreCase); PermissionRoleMatrix = await repository.GetPermissionRoleMatrixAsync(); - foreach (var item in PermissionRoleMatrix.Where(item => item.PermissionDisplayName.StartsWith("L:"))) + + var definedPermissionSet = await permissionDefinitionManager.GetPermissionsAsync(); + var definedPermissionNames = new HashSet(definedPermissionSet.Select(x => x.Name)); + + foreach (var item in PermissionRoleMatrix) { - var parts = item.PermissionDisplayName[2..].Split(','); - if (parts.Length == 2) + item.IsDefined = definedPermissionNames.Contains(item.PermissionName); + + var displayName = item.PermissionDisplayName; + if (displayName.Length > 2 && displayName.StartsWith("L:")) { - var resourceName = parts[0]; - var name = parts[1]; - var displayName = new LocalizableString(name, resourceName); - item.PermissionDisplayName = (await displayName.LocalizeAsync(StringLocalizerFactory))?.Value ?? item.PermissionDisplayName; + var parts = displayName.AsSpan(2).ToString().Split(','); + if (parts.Length == 2) + { + var resourceName = parts[0]; + var name = parts[1]; + var localizable = new LocalizableString(name, resourceName); + var localized = await localizable.LocalizeAsync(StringLocalizerFactory); + item.PermissionDisplayName = localized?.Value ?? displayName; + } } } } diff --git a/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.js b/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.js index 9e68e7a4c..8ad60b312 100644 --- a/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.js +++ b/applications/Unity.GrantManager/modules/Unity.Identity.Web/src/Pages/Identity/Roles/PermissionRoleMatrix.js @@ -22,7 +22,7 @@ const columnDefs = [ { targets: 0, - orderable: false, + orderable: true, className: 'notexport' } ]; diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Repositories/PermissionRoleMatrixRepository.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Repositories/PermissionRoleMatrixRepository.cs index 55bc11f83..ff5113620 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Repositories/PermissionRoleMatrixRepository.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Repositories/PermissionRoleMatrixRepository.cs @@ -83,4 +83,5 @@ public class PermissionRoleMatrixDto public required string PermissionDisplayName { get; set; } public int Depth { get; set; } public required Dictionary RolePermissions { get; set; } + public bool IsDefined { get; set; } = false; } \ No newline at end of file diff --git a/openshift/redis-sentinel/Chart.lock b/openshift/redis-sentinel/Chart.lock index de05c9ddc..55e55af74 100644 --- a/openshift/redis-sentinel/Chart.lock +++ b/openshift/redis-sentinel/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: redis repository: https://charts.bitnami.com/bitnami - version: 18.16.1 -digest: sha256:9790756cef622b027cfb67e6dfe1b2802a3cf74b46ec10e11ae1428becf5cb32 -generated: "2024-02-23T09:58:09.769896-08:00" + version: 21.1.11 +digest: sha256:98f3d6fdc3360f0ea929a647528658e8693cf22ea503a099dc77af35e46af99f +generated: "2025-06-03T11:36:36.363955-07:00" diff --git a/openshift/redis-sentinel/Chart.yaml b/openshift/redis-sentinel/Chart.yaml index 6be03292a..17c6a3aa9 100644 --- a/openshift/redis-sentinel/Chart.yaml +++ b/openshift/redis-sentinel/Chart.yaml @@ -15,15 +15,15 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.1.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.1.0" +appVersion: "7.2.5" dependencies: - name: redis - version: "18.16.1" # Specify the version you want + version: "21.1.11" # Specify the version you want repository: "https://charts.bitnami.com/bitnami" diff --git a/openshift/redis-sentinel/charts/redis-18.16.1.tgz b/openshift/redis-sentinel/charts/redis-18.16.1.tgz deleted file mode 100644 index e8c56a17b..000000000 Binary files a/openshift/redis-sentinel/charts/redis-18.16.1.tgz and /dev/null differ diff --git a/openshift/redis-sentinel/charts/redis-21.1.11.tgz b/openshift/redis-sentinel/charts/redis-21.1.11.tgz new file mode 100644 index 000000000..78e1f139e Binary files /dev/null and b/openshift/redis-sentinel/charts/redis-21.1.11.tgz differ diff --git a/openshift/redis-sentinel/values.yaml b/openshift/redis-sentinel/values.yaml index ed5fb41de..1e6fa8545 100644 --- a/openshift/redis-sentinel/values.yaml +++ b/openshift/redis-sentinel/values.yaml @@ -1,5 +1,6 @@ - redis: + # Bitnami chart version: updated from previous to 21.1.11 + # Redis image tag: updated from 7.2.4-debian-12-r9 to 7.2.5 (see Chart.yaml) fullnameOverride: redis-ha architecture: replication auth: @@ -9,7 +10,7 @@ redis: image: registry: docker.io repository: bitnami/redis - tag: 7.2.4-debian-12-r9 + tag: 7.2.5 # updated from 7.2.4-debian-12-r9, now using default Bitnami Redis 7.2.5 image sentinel: enabled: true masterSet: "redisMasterSet"