Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OATS-CADC
ac
Commits
a73286e3
Commit
a73286e3
authored
10 years ago
by
Brian Major
Browse files
Options
Downloads
Patches
Plain Diff
nep110 - Added UserNotFoundException to GMSClient user membership actions
parent
34bc9381
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/cadcAccessControl/src/ca/nrc/cadc/ac/client/GMSClient.java
+12
-4
12 additions, 4 deletions
...adcAccessControl/src/ca/nrc/cadc/ac/client/GMSClient.java
with
12 additions
and
4 deletions
projects/cadcAccessControl/src/ca/nrc/cadc/ac/client/GMSClient.java
+
12
−
4
View file @
a73286e3
...
...
@@ -494,11 +494,12 @@ public class GMSClient
* @param targetGroupName The group in which to add the group member.
* @param userID The user to add.
* @throws GroupNotFoundException If the group was not found.
* @throws GroupNotFoundException If the member was not found.
* @throws java.io.IOException
* @throws AccessControlException If unauthorized to perform this operation.
*/
public
void
addUserMember
(
String
targetGroupName
,
Principal
userID
)
throws
GroupNotFoundException
,
AccessControlException
,
IOException
throws
GroupNotFoundException
,
UserNotFoundException
,
AccessControlException
,
IOException
{
String
userIDType
=
AuthenticationUtil
.
getPrincipalType
(
userID
);
String
encodedUserID
=
URLEncoder
.
encode
(
userID
.
toString
(),
"UTF-8"
);
...
...
@@ -548,7 +549,10 @@ public class GMSClient
}
if
(
responseCode
==
404
)
{
throw
new
GroupNotFoundException
(
errMessage
);
if
(
errMessage
!=
null
&&
errMessage
.
toLowerCase
().
contains
(
"user"
))
throw
new
UserNotFoundException
(
errMessage
);
else
throw
new
GroupNotFoundException
(
errMessage
);
}
throw
new
IOException
(
errMessage
);
}
...
...
@@ -625,11 +629,12 @@ public class GMSClient
* @param targetGroupName The group from which to remove the group member.
* @param userID The user to remove.
* @throws GroupNotFoundException If the group was not found.
* @throws UserNotFoundException If the member was not found.
* @throws java.io.IOException
* @throws AccessControlException If unauthorized to perform this operation.
*/
public
void
removeUserMember
(
String
targetGroupName
,
Principal
userID
)
throws
GroupNotFoundException
,
AccessControlException
,
IOException
throws
GroupNotFoundException
,
UserNotFoundException
,
AccessControlException
,
IOException
{
String
userIDType
=
AuthenticationUtil
.
getPrincipalType
(
userID
);
String
encodedUserID
=
URLEncoder
.
encode
(
userID
.
toString
(),
"UTF-8"
);
...
...
@@ -681,7 +686,10 @@ public class GMSClient
}
if
(
responseCode
==
404
)
{
throw
new
GroupNotFoundException
(
errMessage
);
if
(
errMessage
!=
null
&&
errMessage
.
toLowerCase
().
contains
(
"user"
))
throw
new
UserNotFoundException
(
errMessage
);
else
throw
new
GroupNotFoundException
(
errMessage
);
}
throw
new
IOException
(
errMessage
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment