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

remove dups from role/group review list #2619

Merged
merged 1 commit into from
May 17, 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 @@ -654,7 +654,7 @@ public class JDBCConnection implements ObjectStoreConnection {
+ " WHERE review_last_notified_time IS NOT NULL ORDER BY review_last_notified_time DESC LIMIT 1;";
private static final String SQL_GROUP_EXPIRY_LAST_NOTIFIED_TIME = "SELECT last_notified_time FROM principal_group_member"
+ " WHERE last_notified_time IS NOT NULL ORDER BY last_notified_time DESC LIMIT 1;";
private static final String SQL_GET_ROLE_REVIEW_LIST = "SELECT domain.name AS domain_name, role.name AS role_name,"
private static final String SQL_GET_ROLE_REVIEW_LIST = "SELECT DISTINCT domain.name AS domain_name, role.name AS role_name,"
+ " role.member_expiry_days, role.service_expiry_days, role.group_expiry_days, role.member_review_days,"
+ " role.service_review_days, role.group_review_days, role.last_reviewed_time, role.created FROM role"
+ " JOIN domain ON role.domain_id=domain.domain_id JOIN role_member ON role.role_id=role_member.role_id WHERE role.trust='' AND"
Expand All @@ -663,7 +663,7 @@ public class JDBCConnection implements ObjectStoreConnection {
+ " role.domain_id IN (SELECT domain.domain_id FROM domain JOIN role ON role.domain_id=domain.domain_id"
+ " JOIN role_member ON role.role_id=role_member.role_id WHERE role_member.principal_id=? AND"
+ " role_member.active=true AND role.name='admin') ORDER BY domain.name, role.name;";
private static final String SQL_GET_GROUP_REVIEW_LIST = "SELECT domain.name AS domain_name, principal_group.name AS group_name,"
private static final String SQL_GET_GROUP_REVIEW_LIST = "SELECT DISTINCT domain.name AS domain_name, principal_group.name AS group_name,"
+ " principal_group.member_expiry_days, principal_group.service_expiry_days, principal_group.last_reviewed_time,"
+ " principal_group.created FROM principal_group JOIN domain ON principal_group.domain_id=domain.domain_id"
+ " JOIN principal_group_member ON principal_group.group_id=principal_group_member.group_id WHERE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,10 @@ private void insertRecordsForRoleReviewTest(final String principal) {
zmsImpl.putRole(ctx, "domain2", "Role1", auditRef, false, null, role);

roleMembers = new ArrayList<>();
roleMembers.add(new RoleMember().setMemberName("user.test1"));
roleMembers.add(new RoleMember().setMemberName(principal));

// Create role1 in domain3 only principal
// Create role1 in domain3 only principal and user.test1
role = zmsTestInitializer.createRoleObject("domain3", "role1", null, roleMembers);
zmsImpl.putRole(ctx, "domain3", "role1", auditRef, false, null, role);

Expand Down Expand Up @@ -406,9 +407,10 @@ private void insertRecordsForGroupReviewTest(final String principal) {
zmsImpl.putGroup(ctx, "domain2", "group1", auditRef, false, null, group);

groupMembers = new ArrayList<>();
groupMembers.add(new GroupMember().setMemberName("user.test1"));
groupMembers.add(new GroupMember().setMemberName(principal));

// Create group1 in domain3 only principal
// Create group1 in domain3 only principal and user.test1
group = zmsTestInitializer.createGroupObject("domain3", "group1", groupMembers);
zmsImpl.putGroup(ctx, "domain3", "group1", auditRef, false, null, group);

Expand Down
Loading