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

[Access control] Private individual page #433

Merged
merged 33 commits into from
Feb 13, 2024

Conversation

litvinovg
Copy link
Member

@litvinovg litvinovg commented Dec 14, 2023

VIVO PR

What does this pull request do?

Created individual access object to check access permission to display individual pages.
Created policy templates to restrict access to individual pages:
Created useConfiguration object property to provide sparql query when sparql query results tested against provided values.
Suppress display of individual by uri (has priority 5000 )
template_suppress_display_individual_page_by_uri.n3
On individual editing form added checkboxes to suppress display of individual for roles
image
Suppress individual page display for a role by type (has priority 1500 )
template_suppress_display_individual_page_by_type.n3
Suppress display of individual by type if individual is not related to self editor profile (has priority 1500 )
template_suppress_display_not_related_individual_page_by_type.n3
On Class Editing Form added checkboxes to suppress display of individual in this class for roles
image

Allow display of page individual (if access wasn't denied by policies with higher priority, this policy has priority 1000) policy_allow_display_individual_page.n3
Suppress display of properties not related to self editor profiles
template_suppress_display_not_related_property_by_uri.n3
On property editing form page added checkbox to suppress display of property in not related individuals
image

Added tests to for new policy templates.

Removed duplicate authorization checks without statement details and graph.
Added named key components to access data sets and value sets by keys
named_key_components.n3
Refactoring:
Store model in AccessObject instead of AccessObjectStatement
Renamed sparql variable personUri to profileUri as it better suits related profiles and leaving it the same could cause confusion in future.
Removed uris String array parameter in PolicyLoader.getDataSetUriByKey method as it is not used anymore, use varargs for literal identifiers. Refactored all related methods.
Replaced ProximityChecker with more abstract SparqlSelectQueryResultsChecker.
Added safety check to AttributeValueSetFactory to avoid reusing not related value set returned by key.
Improved logging in PolicyLoader.

How to test

Policy templates are tested in automatic tests.
Build Vitro and VIVO, try using checkboxes to suppress display of individual pages and properties.

Interested parties

@chenejac

@chenejac chenejac linked an issue Dec 15, 2023 that may be closed by this pull request
@litvinovg litvinovg force-pushed the individual_access_object branch 7 times, most recently from dc5bdcf to 3f1c088 Compare December 21, 2023 11:26
@litvinovg litvinovg marked this pull request as ready for review December 21, 2023 11:26
@litvinovg litvinovg changed the title [Access control] Indivudal access object [Access control] Private individual page Dec 21, 2023
@litvinovg litvinovg force-pushed the individual_access_object branch from 734712b to 7090a4b Compare January 8, 2024 17:22
@litvinovg litvinovg requested a review from chenejac January 9, 2024 13:56
…licyLoader code to support named key components
… to profileUri, created useConfiguration object property to provide sparql query when sparql query results tested against provided values. Replaced ProximityChecker with more abstract SparqlSelectQueryResultsChecker. Added safety check to AttributeValueSetFactory. Improved logging in PolicyLoader.
@litvinovg litvinovg force-pushed the individual_access_object branch from 3d2c640 to bfb5bdd Compare January 12, 2024 13:51
@litvinovg
Copy link
Member Author

@chenejac Added translations for different languages. We need reviews/corrections from native speakers.

Copy link
Contributor

@bkampe bkampe left a comment

Choose a reason for hiding this comment

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

I checked the German translations and think they are fine. Maybe a better wording would be possible, but it's not that easy to build well formed german sentences with these more or less complex statements.

@hauschke
Copy link
Member

Thanks for the changes in German translation, @litvinovg, looks good now.

Copy link
Contributor

@chenejac chenejac left a comment

Choose a reason for hiding this comment

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

@litvinovg great work. Can you please check a couple of my comments?

litvinovg and others added 3 commits January 18, 2024 10:25
Serbian label fixes.

Co-authored-by: Dragan Ivanovic <chenejac@uns.ac.rs>
@litvinovg litvinovg requested a review from chenejac January 18, 2024 12:31
@chenejac chenejac requested a review from ivanmrsulja January 19, 2024 10:01
chenejac
chenejac previously approved these changes Jan 19, 2024
Copy link
Contributor

@chenejac chenejac left a comment

Choose a reason for hiding this comment

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

well done

Copy link
Member

@ivanmrsulja ivanmrsulja left a comment

Choose a reason for hiding this comment

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

Looks good, but I have left some comments that you may find helpfull 🙂

Co-authored-by: Ivan R. Mršulja <nighteliteace@gmail.com>
@chenejac chenejac merged commit 03517df into vivo-project:main Feb 13, 2024
1 check passed
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.

Private individual page
6 participants