public boolean userHasGivenRoleInAnyTenant(StorageOSUser user,Role... roles){
  if (userHasGivenRole(user,URI.create(user.getTenantId()),roles)) {
    return true;
  }
  Map<String,Collection<String>> allSubtenantRoles=null;
  for (  Role role : roles) {
    if (isRoleTenantLevel(role.toString())) {
      if (allSubtenantRoles == null) {
        allSubtenantRoles=getSubtenantRolesForUser(user);
      }
      for (      Collection<String> subtenantRoles : allSubtenantRoles.values()) {
        if (subtenantRoles.contains(role.toString())) {
          return true;
        }
      }
    }
  }
  return false;
}

public boolean userHasGivenRoleInAnyTenant ( StorageOSUser user , Role ... roles ) { if ( userHasGivenRole ( user , URI . create ( user . getTenantId ( ) ) , roles ) ) { return true ; } Map < String , Collection < String > > allSubtenantRoles = null ; for ( Role role : roles ) { if ( isRoleTenantLevel ( role . toString ( ) ) ) { if ( allSubtenantRoles == null ) { allSubtenantRoles = getSubtenantRolesForUser ( user ) ; } for ( Collection < String > subtenantRoles : allSubtenantRoles . values ( ) ) { if ( subtenantRoles . contains ( role . toString ( ) ) ) { return true ; } } } } return false ; }
returns true if the user has any role from the given list in their home tenant or any subtenant . false otherwise .
