fix: project grants (#4031)

* fix: filter granted memberships correctly

* fix: only show changes of granted project

* Apply suggestions from code review

Co-authored-by: Fabi <[email protected]>

* Update internal/query/user_membership.go

Co-authored-by: Fabi <[email protected]>

Co-authored-by: Fabi <[email protected]>
This commit is contained in:
Livio Spring
2022-07-27 07:55:44 +00:00
committed by GitHub
co-authored by Fabi
parent c15577c1f9
commit 5bd9badbcf
14 changed files with 224 additions and 44 deletions
+24
View File
@@ -221,6 +221,8 @@ import {
ListPersonalAccessTokensResponse,
ListProjectChangesRequest,
ListProjectChangesResponse,
ListProjectGrantChangesRequest,
ListProjectGrantChangesResponse,
ListProjectGrantMemberRolesRequest,
ListProjectGrantMemberRolesResponse,
ListProjectGrantMembersRequest,
@@ -1776,6 +1778,28 @@ export class ManagementService {
return this.grpcService.mgmt.listProjectChanges(req, null).then((resp) => resp.toObject());
}
public listProjectGrantChanges(
projectId: string,
grantId: string,
limit: number,
sequence: number,
): Promise<ListProjectGrantChangesResponse.AsObject> {
const req = new ListProjectGrantChangesRequest();
req.setProjectId(projectId);
req.setGrantId(grantId);
const query = new ChangeQuery();
if (limit) {
query.setLimit(limit);
}
if (sequence) {
query.setSequence(sequence);
}
req.setQuery(query);
return this.grpcService.mgmt.listProjectGrantChanges(req, null).then((resp) => resp.toObject());
}
public listUserChanges(userId: string, limit: number, sequence: number): Promise<ListUserChangesResponse.AsObject> {
const req = new ListUserChangesRequest();
req.setUserId(userId);