Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsPur committed Aug 19, 2023
1 parent 7bae2e9 commit 5078ace
Show file tree
Hide file tree
Showing 7 changed files with 365 additions and 301 deletions.
4 changes: 2 additions & 2 deletions roles/database/files/sql/creation/fworch-create-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -919,14 +919,14 @@ Create table "report_template"
"report_template_owner" Integer, --FK
"filterline_history" Boolean Default TRUE, -- every time a filterline is sent, we save it for future usage (auto-deleted every 90 days)
"report_parameters" json,
"viewable_by_all" boolean, -- share with all
"viewable_by_all" boolean Default FALSE, -- share with all
primary key ("report_template_id")
);

Create table "report_template_viewable_by"
(
"report_template_id" integer not null,
"viewer_dn" varchar, -- share with a group / a specific user
"viewer_dn" varchar not null, -- share with a group / a specific user
primary key ("report_template_id", "viewer_dn")
);

Expand Down
17 changes: 16 additions & 1 deletion roles/database/files/upgrade/7.1.0.sql
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
DROP TABLE IF EXISTS "report_template_viewable_by_user";
DO $$
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'report_template_viewable_by_user' AND column_name = 'uiuser_id') THEN
DROP TABLE report_template_viewable_by_user;
END IF;
END $$;

ALTER TABLE report_template
ADD COLUMN viewable_by_all boolean Default FALSE;

Create table if not exists "report_template_viewable_by"
(
"report_template_id" integer not null,
"viewer_dn" varchar not null, -- share with a group / a specific user
primary key ("report_template_id", "viewer_dn")
);
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

namespace FWO.Api.Data
{
public class ReportTemplateViewer
public class LdapUser
{

public DistName Dn { get; set; } = new DistName(null);
}
}
2 changes: 1 addition & 1 deletion roles/lib/files/FWO.Api.Client/Data/ReportTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ReportTemplate
public ReportParams ReportParams { get; set; } = new ReportParams();

[JsonProperty("viewable_by"), JsonPropertyName("viewable_by")]
public ReportTemplateViewer[] Viewer { get; set; } = new ReportTemplateViewer[0];
public DistName[] Viewer { get; set; } = new DistName[0];

public bool Detailed = false;

Expand Down
11 changes: 5 additions & 6 deletions roles/lib/files/FWO.Middleware.Client/MiddlewareClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ public async Task<RestResponse<List<RoleGetReturnParameters>>> GetAllRoles()
return await restClient.ExecuteAsync<List<RoleGetReturnParameters>>(request);
}

public async Task<RestResponse<List<string>>> GetGroups()
public async Task<RestResponse<List<GroupGetReturnParameters>>> GetGroups()
{
RestRequest request = new RestRequest("Group/Get", Method.Get);
return await restClient.ExecuteAsync<List<string>>(request);
RestRequest request = new RestRequest("Group", Method.Get);
return await restClient.ExecuteAsync<List<GroupGetReturnParameters>>(request);
}

public async Task<RestResponse<List<string>>> GetGroups(GroupGetParameters parameters)
Expand All @@ -123,11 +123,10 @@ public async Task<RestResponse<List<GroupGetReturnParameters>>> GetInternalGroup
return await restClient.ExecuteAsync<List<GroupGetReturnParameters>>(request);
}

public async Task<RestResponse<List<UserGetReturn>>> GetUsers()
public async Task<RestResponse<List<LdapUserGetReturn>>> GetUsers()
{
RestRequest request = new RestRequest("User", Method.Get);
request.AddJsonBody(new object());
return await restClient.ExecuteAsync<List<UserGetReturn>>(request);
return await restClient.ExecuteAsync<List<LdapUserGetReturn>>(request);
}

public async Task<RestResponse<List<LdapUserGetReturn>>> GetUsers(LdapUserGetParameters parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task<ActionResult<List<GroupGetReturnParameters>>> Get()

foreach (Ldap currentLdap in ldaps)
{
if (currentLdap.IsInternal() && currentLdap.HasGroupHandling())
if (currentLdap.HasGroupHandling())
{
ldapGroupRequests.Add(Task.Run(() =>
{
Expand Down
Loading

0 comments on commit 5078ace

Please sign in to comment.