code: public void addResourceToOrgUnit(CmsRequestContext context, CmsOrganizationalUnit orgUnit, CmsResource resource)
      throws CmsException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              checkOfflineProject(dbc);
              checkRole(dbc, CmsRole.ADMINISTRATOR.forOrgUnit(orgUnit.getName()));
              m_driverManager.addResourceToOrgUnit(dbc, orgUnit, resource);
          } catch (Exception e) {
              dbc.report(
                  null,
                  Messages.get().container(
                      Messages.ERR_ADD_RESOURCE_TO_ORGUNIT_2,
                      orgUnit.getName(),
                      dbc.removeSiteRoot(resource.getRootPath())),
                  e);
          } finally {
              dbc.clear();
          }
      }
docs: Adds a resource to the given organizational unit.<p>
  
  @param context the current request context
  @param orgUnit the organizational unit to add the resource to
  @param resource the resource that is to be added to the organizational unit
  
  @throws CmsException if something goes wrong
  
  @see org.opencms.security.CmsOrgUnitManager#addResourceToOrgUnit(CmsObject, String, String)
  @see org.opencms.security.CmsOrgUnitManager#removeResourceFromOrgUnit(CmsObject, String, String)