public QueryResult<Group> deleteGroup(String studyStr, String groupId, String sessionId) throws CatalogException {
String userId = catalogManager.getUserManager().getUserId(sessionId);
Study study = resolveId(studyStr, userId);
if (!groupId.startsWith("@")) {
groupId = "@" + groupId;
}
authorizationManager.checkCreateDeleteGroupPermissions(study.getUid(), userId, groupId);
QueryResult<Group> group = studyDBAdaptor.getGroup(study.getUid(), groupId, Collections.emptyList());
group.setId("Delete group");
Study.StudyAclParams aclParams = new Study.StudyAclParams(null, AclParams.Action.RESET, null);
updateAcl(Collections.singletonList(studyStr), groupId, aclParams, sessionId);
studyDBAdaptor.deleteGroup(study.getUid(), groupId);
return group;
}