Public permalink to private md#9059
Conversation
core/src/main/java/org/fao/geonet/kernel/security/ViewMdGrantedAuthority.java
Show resolved
Hide resolved
core/src/main/java/org/fao/geonet/security/GrantViewMdAuthorityFilter.java
Show resolved
Hide resolved
core/src/test/java/org/fao/geonet/kernel/search/EsFilterBuilderTest.java
Show resolved
Hide resolved
core/src/test/java/org/fao/geonet/kernel/security/ResourceLibCheckPrivilegeTest.java
Show resolved
Hide resolved
core/src/test/java/org/fao/geonet/security/GrantViewAuthorityFilterTest.java
Show resolved
Hide resolved
domain/src/main/java/org/fao/geonet/repository/AnonymousAccessLinkRepository.java
Show resolved
Hide resolved
domain/src/test/java/org/fao/geonet/repository/AnonymousAccessLinkRepositoryTest.java
Show resolved
Hide resolved
services/src/main/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkApi.java
Outdated
Show resolved
Hide resolved
services/src/test/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkApiTest.java
Outdated
Show resolved
Hide resolved
a45c663 to
9040494
Compare
8a077fe to
2f4a5ab
Compare
5ac61b1 to
c240e76
Compare
pmauduit
left a comment
There was a problem hiding this comment.
Some minor comments here, looks good globally.
Is it on purpose that the feature is reserved to administrators ? I would have expected that some Editors, reviewers, admin_users could also have the need to share their work.
core/src/main/java/org/fao/geonet/security/GrantViewMdAuthorityFilter.java
Outdated
Show resolved
Hide resolved
services/src/main/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkApi.java
Outdated
Show resolved
Hide resolved
services/src/main/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkApi.java
Outdated
Show resolved
Hide resolved
services/src/main/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkApi.java
Outdated
Show resolved
Hide resolved
services/src/main/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkApi.java
Outdated
Show resolved
Hide resolved
services/src/main/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkApi.java
Outdated
Show resolved
Hide resolved
services/src/main/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkService.java
Outdated
Show resolved
Hide resolved
services/src/main/java/org/fao/geonet/api/anonymousAccessLink/AnonymousAccessLinkApi.java
Outdated
Show resolved
Hide resolved
bf301e6 to
2ee7d31
Compare
There was a problem hiding this comment.
Any new feature PRs requires documentation. It can be very minimal just to note the feature exists; but we want something :)
I really like this feature, when I have seen similar features in other products they may have a timeout associated with the token, or were associated with a specific email address. That may be overkill for the intension of sharing an edit already in progress.
|
Ideas for discussion. Share Record Preview / Remove Record PreviewThe name of the feature "createAnonymousAccess" and "deleteAnonymousAccess" obviously needs to be internationalized. May I suggest a wording change of "Share Record Preview", and "Remove Record Preview". I think that would match the intended use, and "delete" tends to indicate something is gone forever. "Share Draft Record" / "Remove Draft Record" may also work and match up with the state in the review workflow better. Record Preview BannerWhen viewing a record preview, it would be great to have an overlay or underlay indicating this is a "preview" and not official. You some times see that in documents written as "DRAFT". |
|
Taking into account https://docs.geonetwork-opensource.org/4.4/user-guide/workflow/life-cycle/#record-life-cycle, in order to avoid confusion, we choose not to use "draft" term as it could remind of workflow and we prefer "Share unpublished record preview". |
1a6fd9b to
a5d99d0
Compare
a3a2c99 to
57295d3
Compare
|
not existing link deletion test
…pository only if viewMdAuthority is granted
choosen encryption algorithm forbid comparaison of same hash encrypted twice, have to first fecth stored crypted hash corresponding to uuid, then to check for match.
Co-authored-by: Pierre Mauduit <pmauduit@users.noreply.github.com> Co-authored-by: Pierre Mauduit <pmauduit@users.noreply.github.com> Co-authored-by: Pierre Mauduit <pmauduit@users.noreply.github.com> Co-authored-by: Pierre Mauduit <pmauduit@users.noreply.github.com> Co-authored-by: Pierre Mauduit <pmauduit@users.noreply.github.com>
208a7f5 to
bffca75
Compare
Allow a gn admin to get a 'token' which can be used by an anonymous user to have a read access to a non published md and to its resources (for reviewing purposes). Each time the token is used once in an http session as a request parameter, it grants the session the extra authorization if not already granted.
Extra granted authorizations/tokens can be created from simple view, revoked from simple view, listed from admin menu, revoked from list.
Extra granted authorizations cannot be created for published md, publishing an md revoke its associated link if one.
Token has two parts, a "hash", stored encrypted in db, and the md uuid, so not to have to decrypt all the db stored hash when checking for validity, match is performed against the stored hash corresponding to the uuid (encryption algorithm forbid comparaison of same hash encrypted twice, encrypting the hash twice return two different results, only checking for match is possible).
published md:

private md with no right granted:

granting access (hash is displayed only once):

private md with access granted:

granted access list:

Checklist
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentationFunded by IRD