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

Role optional #753

Merged
merged 6 commits into from
Aug 17, 2019
Merged

Role optional #753

merged 6 commits into from
Aug 17, 2019

Conversation

abvaidya
Copy link
Collaborator

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Abhijeet Vaidya and others added 5 commits August 14, 2019 10:42
@@ -90,10 +90,10 @@
+ "WHERE role.role_id=? AND principal.name=? AND role_member.active=true;";
private static final String SQL_GET_ROLE_MEMBER_EXISTS = "SELECT principal_id FROM role_member WHERE role_id=? AND principal_id=?;";
private static final String SQL_GET_ROLE_MEMBER_INACTIVE_EXISTS = "SELECT principal_id FROM role_member WHERE role_id=? AND principal_id=? AND active=false;";
private static final String SQL_LIST_ROLE_MEMBERS = "SELECT principal.name, role_member.expiration FROM principal "
private static final String SQL_LIST_ROLE_MEMBERS = "SELECT principal.name, role_member.expiration, role_member.active FROM principal "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to make this a conditional? don't we already have active set to 1 by default? so isn't it as simple as:

WHERE role.role_id=? AND role_member.active=?

@@ -1288,7 +1290,15 @@ public int countRoles(String domainName) {
throw notFoundError(caller, ZMSConsts.OBJECT_ROLE, ZMSUtils.roleResourceName(domainName, roleName));
}
List<RoleMember> members = new ArrayList<>();
try (PreparedStatement ps = con.prepareStatement(SQL_LIST_ROLE_MEMBERS)) {

String query = SQL_LIST_ROLE_MEMBERS;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment about the query string.

@havetisyan havetisyan merged commit 77625e2 into AthenZ:master Aug 17, 2019
@abvaidya abvaidya deleted the role-optional branch August 20, 2019 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants