docs: protected boolean hasRole(CmsRole role, List<CmsGroup> roles) {
  
          // iterates the role groups the user is in
          for (CmsGroup group : roles) {
              String groupName = group.getName();
              // iterate the role hierarchy
              for (String distictGroupName : role.getDistinctGroupNames()) {
                  if (distictGroupName.startsWith(CmsOrganizationalUnit.SEPARATOR)) {
                      // this is a ou independent role
                      // we need an exact match, and we ignore the ou parameter
                      if (groupName.equals(distictGroupName.substring(1))) {
                          return true;
                      }
                  } else {
                      // first check if the user has the role at all
                      if (groupName.endsWith(CmsOrganizationalUnit.SEPARATOR + distictGroupName)
                          || groupName.equals(distictGroupName)) {
                          // this is a ou dependent role
                          if (role.getOuFqn() == null) {
                              // ou parameter is null, so the user needs to have the role in at least one ou does not matter which
                              return true;
                          } else {
                              // the user needs to have the role in the given ou or in a parent ou
                              // now check that the ou matches
                              String groupFqn = CmsOrganizationalUnit.getParentFqn(groupName);
                              if (role.getOuFqn().startsWith(groupFqn)) {
                                  return true;
                              }
                          }
                      }
                  }
              }
          }
          return false;
      }