Skip to content

Instantly share code, notes, and snippets.

@ottenhoff
Created February 9, 2021 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottenhoff/d3b6f1fddd530cce543abfa8b56cb02c to your computer and use it in GitHub Desktop.
Save ottenhoff/d3b6f1fddd530cce543abfa8b56cb02c to your computer and use it in GitHub Desktop.
diff --git a/site-manage/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java b/site-manage/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
index 353109463c..5d50c457e4 100644
--- a/site-manage/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
+++ b/site-manage/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
@@ -72,7 +72,6 @@ import org.sakaiproject.archive.api.ImportMetadata;
import org.sakaiproject.archive.cover.ArchiveService;
import org.sakaiproject.authz.api.AuthzGroup;
import org.sakaiproject.authz.api.AuthzPermissionException;
-import org.sakaiproject.authz.api.AuthzRealmLockException;
import org.sakaiproject.authz.api.GroupNotDefinedException;
import org.sakaiproject.authz.api.Member;
import org.sakaiproject.authz.api.PermissionsHelper;
@@ -8721,12 +8720,12 @@ private Map<String, List<MyTool>> getTools(SessionState state, String type, Site
securityService.pushAdvisor(yesMan);
SiteService.saveGroupMembership(currentSite);
- } catch (AuthzRealmLockException e) {
- log.error(".doJoinableSet: User with id {} cannot be inserted in group with id {} because the group is locked", userId, siteGroup.getId());
} catch (IdUnusedException e) {
log.error("IdUnusedException while joining site, userId={}, siteId={}, groupId={}", userId, currentSite.getId(), siteGroup.getId());
} catch (PermissionException e) {
log.error("doJoinableSet could not save new membership because of permissions", e);
+ } catch (Exception e) {
+ log.error(".doJoinableSet: User with id {} cannot be inserted in group with id {} because the group is locked", userId, siteGroup.getId());
} finally {
securityService.popAdvisor(yesMan);
}
@@ -8789,10 +8788,10 @@ private Map<String, List<MyTool>> getTools(SessionState state, String type, Site
securityService.pushAdvisor(yesMan);
SiteService.saveGroupMembership(currentSite);
- } catch (AuthzRealmLockException e) {
- log.error(".doUnjoinableSet: User with id {} cannot be deleted from group with id {} because the group is locked", userId, siteGroup.getId());
} catch (PermissionException e) {
log.error("doUnjoinableSet: permission exception as userId={}", userId, e);
+ } catch (Exception e) {
+ log.error(".doUnjoinableSet: User with id {} cannot be deleted from group with id {} because the group is locked", userId, siteGroup.getId());
} finally {
securityService.popAdvisor(yesMan);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment