-
Notifications
You must be signed in to change notification settings - Fork 86
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
[Access control] Private individual page #433
Conversation
dc5bdcf
to
3f1c088
Compare
734712b
to
7090a4b
Compare
…euse it for IndividualAccessObject
…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.
3d2c640
to
bfb5bdd
Compare
@chenejac Added translations for different languages. We need reviews/corrections from native speakers. |
home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
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.
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.
home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
Thanks for the changes in German translation, @litvinovg, looks good now. |
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.
@litvinovg great work. Can you please check a couple of my comments?
api/src/main/java/edu/cornell/mannlib/vedit/controller/BaseEditController.java
Outdated
Show resolved
Hide resolved
api/src/main/java/edu/cornell/mannlib/vedit/controller/BaseEditController.java
Outdated
Show resolved
Hide resolved
api/src/main/java/edu/cornell/mannlib/vedit/controller/BaseEditController.java
Outdated
Show resolved
Hide resolved
api/src/main/java/edu/cornell/mannlib/vedit/controller/BaseEditController.java
Outdated
Show resolved
Hide resolved
api/src/main/java/edu/cornell/mannlib/vitro/webapp/auth/policy/PolicyLoader.java
Show resolved
Hide resolved
...test/java/edu/cornell/mannlib/vitro/webapp/auth/policy/AllowDisplayIndividualPagePolicy.java
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
Serbian label fixes. Co-authored-by: Dragan Ivanovic <chenejac@uns.ac.rs>
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.
well done
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.
Looks good, but I have left some comments that you may find helpfull 🙂
home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl
Outdated
Show resolved
Hide resolved
.../main/java/edu/cornell/mannlib/vitro/webapp/auth/checks/SparqlSelectQueryResultsChecker.java
Show resolved
Hide resolved
.../main/java/edu/cornell/mannlib/vitro/webapp/auth/checks/SparqlSelectQueryResultsChecker.java
Show resolved
Hide resolved
api/src/main/java/edu/cornell/mannlib/vitro/webapp/auth/checks/CheckFactory.java
Show resolved
Hide resolved
api/src/main/java/edu/cornell/mannlib/vitro/webapp/auth/attributes/AttributeValueKey.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Ivan R. Mršulja <nighteliteace@gmail.com>
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
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
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
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