### Eclipse Workspace Patch 1.0 #P opencms Index: src/org/opencms/db/CmsDriverManager.java =================================================================== RCS file: /usr/local/cvs/opencms/src/org/opencms/db/CmsDriverManager.java,v retrieving revision 1.627 diff -u -r1.627 CmsDriverManager.java --- src/org/opencms/db/CmsDriverManager.java 1 Jul 2008 10:08:54 -0000 1.627 +++ src/org/opencms/db/CmsDriverManager.java 10 Sep 2008 10:20:16 -0000 @@ -1226,37 +1226,39 @@ OpenCms.getValidationHandler().checkGroupName(CmsOrganizationalUnit.getSimpleName(name)); // trim the name name = name.trim(); - // check the ou - readOrganizationalUnit(dbc, CmsOrganizationalUnit.getParentFqn(name)); - - // get the id of the parent group if necessary - if (CmsStringUtil.isNotEmpty(parent)) { - CmsGroup parentGroup = readGroup(dbc, parent); - if (!parentGroup.isRole() - && !CmsOrganizationalUnit.getParentFqn(parent).equals(CmsOrganizationalUnit.getParentFqn(name))) { - throw new CmsDataAccessException(Messages.get().container( - Messages.ERR_PARENT_GROUP_MUST_BE_IN_SAME_OU_3, - CmsOrganizationalUnit.getSimpleName(name), - CmsOrganizationalUnit.getParentFqn(name), - parent)); + if (OpenCms.getRunLevel() >= OpenCms.RUNLEVEL_4_SERVLET_ACCESS) { + // check the ou - for the sake of Maven VFS Plugin not in Shell Access Level + readOrganizationalUnit(dbc, CmsOrganizationalUnit.getParentFqn(name)); + + // get the id of the parent group if necessary + if (CmsStringUtil.isNotEmpty(parent)) { + CmsGroup parentGroup = readGroup(dbc, parent); + if (!parentGroup.isRole() + && !CmsOrganizationalUnit.getParentFqn(parent).equals(CmsOrganizationalUnit.getParentFqn(name))) { + throw new CmsDataAccessException(Messages.get().container( + Messages.ERR_PARENT_GROUP_MUST_BE_IN_SAME_OU_3, + CmsOrganizationalUnit.getSimpleName(name), + CmsOrganizationalUnit.getParentFqn(name), + parent)); + } } } - // create the group CmsGroup group = m_userDriver.createGroup(dbc, id, name, description, flags, parent); - // if group is virtualizing a role, initialize it - if (group.isVirtual()) { - // get all users that have the given role - String groupname = CmsRole.valueOf(group).getGroupName(); - Iterator it = getUsersOfGroup(dbc, groupname, true, false, true).iterator(); - while (it.hasNext()) { - CmsUser user = (CmsUser)it.next(); - // put them in the new group - addUserToGroup(dbc, user.getName(), group.getName(), true); + if (OpenCms.getRunLevel() >= OpenCms.RUNLEVEL_4_SERVLET_ACCESS) { + // if group is virtualizing a role, initialize it - for the sake of Maven VFS Plugin not in Shell Access Level + if (group.isVirtual()) { + // get all users that have the given role + String groupname = CmsRole.valueOf(group).getGroupName(); + Iterator it = getUsersOfGroup(dbc, groupname, true, false, true).iterator(); + while (it.hasNext()) { + CmsUser user = (CmsUser)it.next(); + // put them in the new group + addUserToGroup(dbc, user.getName(), group.getName(), true); + } } } - // put it into the cache OpenCms.getMemoryMonitor().cacheGroup(group); // return it