-
Notifications
You must be signed in to change notification settings - Fork 31
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
jargon groupadmin new operations: addUser and removeUserFromGroup #392
Labels
Milestone
Comments
Excellent I will add them!
…On Sat, Aug 21, 2021, 10:43 AM Andrey Tsyganov ***@***.***> wrote:
At the moment at least two useful calls in Jargon are missing concerning
groupadmin operations (AsGroupAdmin calls).
We've made our custom implementation, maybe it will be good to add this to
kernel jargon.
Two methods to UserAdminInp.java:
1. addUserAsGroupAdmin:
public static RugUserAdminImp instanceForRemoveUserToGroup(final String userGroupName, final String userName,
final String zoneName) throws JargonException {
if (userGroupName == null || userGroupName.isEmpty()) {
throw new IllegalArgumentException("null userGroupName");
}
if (userName == null || userName.isEmpty()) {
throw new IllegalArgumentException("null UserName");
}
if (zoneName == null || zoneName.isEmpty()) {
throw new IllegalArgumentException("null or empty zoneName");
}
return new RugUserAdminImp("modify", "group", userGroupName, "remove", userName, zoneName, BLANK, BLANK, BLANK, BLANK,
USER_ADMIN_INP_API_NBR);
}
1. removeUserfromGroupAsGroupAdmin:
public static RugUserAdminImp instanceForCreateUser(final User user) throws JargonException {
if (user == null) {
throw new JargonException("null user");
}
if (user.getName().isEmpty()) {
throw new JargonException("blank user name");
}
if (user.getUserType() == UserTypeEnum.RODS_UNKNOWN) {
throw new JargonException("unknown user type");
}
return new RugUserAdminImp("mkuser", user.getName(), user.getUserType().getTextValue(), BLANK, BLANK, BLANK, BLANK,
BLANK, BLANK, BLANK, USER_ADMIN_INP_API_NBR);
}
and then simple change in UserGroupAO:
void removeUserFromGroupAsGroupAdmin(String userGroupName, String userName, String zoneName)
throws InvalidUserException, InvalidGroupException, JargonException;
void addUserAsGroupAdmin(User p_user)
throws InvalidUserException, InvalidGroupException, JargonException;
and UserGroupAOImpl:
@OverRide
public void removeUserFromGroupAsGroupAdmin(final String userGroupName, final String userName, final String zoneName)
throws InvalidUserException, InvalidGroupException, JargonException {
log.info("removeUserFromGroup()");
if (userGroupName == null || userGroupName.isEmpty()) {
throw new IllegalArgumentException("null or emtpy userGroupName");
}
if (userName == null || userName.isEmpty()) {
throw new IllegalArgumentException("null or emtpy userName");
}
log.info("userName:{}", userName);
log.info("userGroupName:{}", userGroupName);
if (zoneName != null) {
log.info("zoneName:{}", zoneName);
}
// call the iadmin iRODS service
RugUserAdminImp adminPI = RugUserAdminImp.instanceForRemoveUserToGroup(userGroupName, userName, zoneName);
log.debug("executing admin PI");
getIRODSProtocol().irodsFunction(adminPI);
}
@OverRide
public void addUserAsGroupAdmin(final User user)
throws InvalidUserException, InvalidGroupException, JargonException {
log.info("addUserAsGroupAdmin()");
RugUserAdminImp adminPI = RugUserAdminImp.instanceForCreateUser(user);
log.debug("executing admin PI");
getIRODSProtocol().irodsFunction(adminPI);
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#392>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIL4LMIRXHA2CD7ZKZIVXLT563SPANCNFSM5CR5IETQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment at least two useful calls in Jargon are missing concerning groupadmin operations (AsGroupAdmin calls).
We've made our custom implementation, maybe it will be good to add this to kernel jargon.
Two methods to UserAdminInp.java:
and then simple change in UserGroupAO:
and UserGroupAOImpl:
The text was updated successfully, but these errors were encountered: