code: private boolean hasRoleForApp(I_CmsWorkplaceAppConfiguration app) {
  
          if (m_user != null) {
              return OpenCms.getRoleManager().hasRole(m_cms, m_user.getName(), app.getRequiredRole());
          }
  
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_group.getValue())) {
              try {
                  CmsGroup group = m_cms.readGroup(m_group.getValue());
                  CmsRole roleFromGroup = CmsRole.valueOf(group);
                  CmsRole roleFromField = (CmsRole)m_role.getValue();
                  if (!roleFromGroup.getChildren(true).contains(roleFromField)) {
                      roleFromGroup = roleFromField;
                  }
                  if (roleFromGroup == null) {
                      return false;
                  }
                  List<CmsRole> groupRoles = roleFromGroup.getChildren(true);
                  groupRoles.add(roleFromGroup);
                  List<String> roleNames = new ArrayList<String>();
                  for (CmsRole gr : groupRoles) {
                      roleNames.add(gr.getRoleName());
                  }
                  return roleNames.contains(app.getRequiredRole().getRoleName());
              } catch (CmsException e) {
                  LOG.error("Unable to read group", e);
              }
          }
          return true;
      }
docs: Checks if user, which gets edited, has role for given app.<p>
  
  @param app to be checked
  @return true if user has role