-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* more permissions tests * refactoring and permission integration tests for images * updated redaction policy * make linter happy
- Loading branch information
Showing
18 changed files
with
387 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletions
18
src/services/articles/resources/contentItemRedactionPolicyWebApp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
# yaml-language-server: $schema=../../../schema/common/redactionPolicy.json | ||
name: content-item-redaction-policy | ||
items: | ||
- jsonPath: $.title | ||
valueConverterName: redact | ||
# NOTE: decided to show title and fragment so that guest users can see at least something | ||
# - jsonPath: $.title | ||
# valueConverterName: redact | ||
- jsonPath: $.excerpt | ||
valueConverterName: redact | ||
- jsonPath: $.content | ||
valueConverterName: redact | ||
# NOTE: decided to show title and fragment so that guest users can see at least something | ||
# - jsonPath: $.matches.[*].fragment | ||
# valueConverterName: redact | ||
- jsonPath: $.regions.[*].iiifFragment | ||
valueConverterName: contextNotAllowedImage | ||
- jsonPath: $.pages.[*].iiif | ||
valueConverterName: contextNotAllowedImage | ||
- jsonPath: $.pages.[*].iiifThumbnail | ||
valueConverterName: contextNotAllowedImage | ||
- jsonPath: $.pages.[*].iiifFragment | ||
valueConverterName: contextNotAllowedImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
// Initializes the `images` service on path `/images` | ||
const createService = require('./images.class.js'); | ||
const hooks = require('./images.hooks'); | ||
import hooks from './images.hooks' | ||
const createService = require('./images.class.js') | ||
|
||
module.exports = function (app) { | ||
// Initialize our service with any options it requires | ||
app.use('/images', createService({ | ||
app, | ||
name: 'images', | ||
})); | ||
app.use( | ||
'/images', | ||
createService({ | ||
app, | ||
name: 'images', | ||
}) | ||
) | ||
|
||
// Get our initialized service so that we can register hooks | ||
const service = app.service('images'); | ||
const service = app.service('images') | ||
|
||
service.hooks(hooks); | ||
}; | ||
service.hooks(hooks) | ||
} |
17 changes: 17 additions & 0 deletions
17
src/services/images/resources/imageRedactionPolicyWebApp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# yaml-language-server: $schema=../../../schema/common/redactionPolicy.json | ||
name: image-redaction-policy | ||
items: | ||
- jsonPath: $.title | ||
valueConverterName: redact | ||
- jsonPath: $.article.[*].title | ||
valueConverterName: redact | ||
- jsonPath: $.article.[*].excerpt | ||
valueConverterName: redact | ||
- jsonPath: $.article.[*].content | ||
valueConverterName: redact | ||
- jsonPath: $.regions.[*].iiifFragment | ||
valueConverterName: contextNotAllowedImage | ||
- jsonPath: $.pages.[*].iiifThumbnail | ||
valueConverterName: contextNotAllowedImage | ||
- jsonPath: $.pages.[*].iiif | ||
valueConverterName: contextNotAllowedImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ class Service { | |
|
||
return client | ||
.run({ | ||
task: task, | ||
task, | ||
args: [ | ||
// user id | ||
params.user.id, | ||
|
Oops, something went wrong.