-
Notifications
You must be signed in to change notification settings - Fork 48
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
Permissions attribute for targets, filtering logic and migrations #1175
base: dev
Are you sure you want to change the base?
Conversation
Adds a permissions field on the Target that allows for filtering prior to doing row-level permissions for open/public targets. This significantly improves performance for TOMs with large datasets that are mostly open or public. Included migrations should handle the transition transparently. Todo: [] Extend filtering logic beyond the TargetList view. [] Update target creation logic away from the Public group. [] Apply logic to non-target models? [] Tests. [] Clean up any remaining 'Public' group logic. [] Update documentation.
It doesn't make a lot of sense to display the group form on the target create/update forms if the target is not private. This commit introduces a UI using a small amount of javascript that will hide the group form unless the user sets the target to private. Because this wasn't possible to implement with the generic form rendering in use, this commit also updates the target update and create forms to use a more compact layout instead of placing every field on a single row, increasing usability. The fields will still collapse to single rows on narrow viewports. Custom target types will default to the generic form rendering as before.
@@ -306,6 +311,10 @@ class BaseTarget(models.Model): | |||
auto_now=True, verbose_name='Last Modified', | |||
help_text='The time which this target was changed in the TOM database.' | |||
) | |||
permissions = models.CharField( | |||
max_length=100, default=Permissions.PUBLIC, choices=Permissions.choices, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set the default to private? It's possible people have built pipelines already with the assumption that newly created targets will have row-level permissions enforced.
@@ -35,3 +34,6 @@ <h3>Tags</h3> | |||
{% endbuttons %} | |||
</form> | |||
{% endblock %} | |||
{% block extra_javascript %} | |||
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alpine.js is going to be useful for some of the other stories relating to making the UI more responsive. I'm not up to date on how we are handling static assets, but at the least this can be moved to base.html
.
Adds a permissions field on the Target that allows for filtering prior to doing row-level permissions for open/public targets. This significantly improves performance for TOMs with large datasets that are mostly open or public.
Included migrations should handle the transition transparently.
Todo: