-
Notifications
You must be signed in to change notification settings - Fork 276
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
Role optional #753
Conversation
AthenZ#746) * Adding a new API to get pending members for audit enabled or selfserve roles * using latest version of GO and NODE in travis * review comments changes
servers/zms/src/main/java/com/yahoo/athenz/zms/store/file/FileConnection.java
Outdated
Show resolved
Hide resolved
@@ -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 " |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
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.