dl.setInt(3, groupDetail.getOwner());
dl.executeUpdate();
gid = dl.getAutoGeneratedKey();
// Everything is created now apply the default permissions for this user.
InitialContext ic = CVUtility.getInitialContext();
AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
AuthorizationLocal authorizationLocal = authorizationHome.create();
authorizationLocal.setDataSource(dataSource);
authorizationLocal.saveCurrentDefaultPermission("Group", gid, userId);
} catch (Exception e) {
logger.error("[createGroup]: Exception", e);
} finally {