Skip to content
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

Only let Datahub Support remove workspace leads from workspaces #1486

Merged
merged 4 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@
@rowContext.PortalUser.Email
</MudTd>
<MudTd Style="@(IsModified(rowContext) ? _modifiedCellStyle : string.Empty)">
<DatahubAuthView AuthLevel="DatahubAuthView.AuthLevels.WorkspaceAdmin" ProjectAcronym="@WorkspaceAcronym">

<DatahubAuthView AuthLevel="@GetAuthLevel(rowContext)" ProjectAcronym="@WorkspaceAcronym">
<Authorized>
@{
var updateCommand = _usersToUpdate.FirstOrDefault(x => x.ProjectUser.PortalUser.Id == rowContext.PortalUser.Id);
Expand Down Expand Up @@ -231,4 +232,6 @@
private List<Datahub_Project_User> _currentlySelected = new();

private string _modifiedCellStyle;


}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Datahub.Application.Commands;
using Datahub.Application.Services;
using Datahub.Core.Components.AuthViews;
using Datahub.Core.Model.Projects;
using Datahub.Shared.Entities;
using Microsoft.EntityFrameworkCore;
Expand Down Expand Up @@ -100,7 +101,10 @@ private bool IsModified(Datahub_Project_User projectUser)
{
return _usersToUpdate.Any(x => x.ProjectUser.PortalUser.GraphGuid == projectUser.PortalUser.GraphGuid);
}

private DatahubAuthView.AuthLevels GetAuthLevel(Datahub_Project_User projectUser)
{
return projectUser.Role?.Id == 2 ? DatahubAuthView.AuthLevels.DatahubSupport : DatahubAuthView.AuthLevels.WorkspaceAdmin;
}
private void ChangeDataStewardFlag(Datahub_Project_User projectUser, bool newValue)
{
projectUser.IsDataSteward = newValue;
Expand Down