Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expandable fields: Skip expansion if the value or service is None #472

Closed

Conversation

max-moser
Copy link
Contributor

Some entities are abstract and not backed by a service, like system roles.

It might be however that we encounter such entities during expansion, among others.
One such case is the expansion process for access grants, which allows the referenced entities to be users (:heavy_check_mark: ), roles (:heavy_check_mark:) or system roles (:x:).

This PR chooses to ignore/skip entities that don't have a service with which to resolve them, because that's simpler than adding code in other places that checks for entity types explicitly before trying to dump result lists with expansion on.

v, service = field.get_value_service(value)
if v is None or service is None:
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would the grants be expanded then? Reading the premise of the PR, you skip resolving but would you still use an expandable field?

* some entities are abstract and not backed by a service, like system
  roles
@max-moser
Copy link
Contributor Author

Added a dummy service in RDM-Records for the entities in question, so this isn't necessary anymore.

@max-moser max-moser closed this Jul 6, 2023
@max-moser max-moser deleted the mm/access-requests branch July 6, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access requests
2 participants