INNER CODE UNIT · JavaScript

newRole

infrahq/infra · ui/pages/destinations/[id]/index.js:198

      const newRole = newPrivilege.filter(x => !selectedPrivilege.includes(x))
      onUpdate(newRole, resource)
    } else {
      // update to delete roles
      const removeRoles = selectedPrivilege.filter(
        x => !newPrivilege.includes(x)
      )

      const deleteGrantIdList = grantsList
        .filter(g => g.resource === resource)
        .filter(g => g.user === grant.user)
        .filter(g => g.group === grant.group)
        .filter(g => removeRoles.includes(g.privilege))
        .map(g => g.id)
      onRemove(deleteGrantIdList)
    }
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…