Commit 9ac589b3 authored by Anton's avatar Anton

Fix recursive ACL setting, update CHANGELOG

parent 08ee6ccb
......@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
No changes yet.
## [1.1.1] - 2019-01-28
### Fixed
- Recursive setting of ACL for a timeline's associated annotations now traverses the full relational depth.
## [1.1.0] - 2018-12-11
### Added
......@@ -55,6 +61,7 @@ No changes yet.
- Start proper versioning at 1.0.0
[Unreleased]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.1.0...master
[Unreleased]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.1.1...master
[1.1.1]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.1.0...v1.1.1
[1.1.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.0.0...v1.1.0
[1.0.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/initial...v1.0.0
......@@ -131,13 +131,21 @@
async setACL (action, payload, recursive = false) {
await this.$store.dispatch(action, payload)
if (recursive) {
const results = await this.$store.dispatch('annotations/find', { 'target.id': payload.id })
for (let item of results.items) {
if (item.author.id === this.$store.state.auth.user.uuid) {
const itemPayload = ObjectUtil.merge({}, payload)
itemPayload.uuid = item.uuid
await this.$store.dispatch(action, itemPayload)
}
await this.setRelatedACLForTarget(payload.id, action, payload)
}
},
async setRelatedACLForTarget (targetId, action, payload) {
const results = await this.$store.dispatch('annotations/find', {
'target.id': targetId,
'author.id': this.$store.state.auth.user.uuid
})
for (let item of results.items) {
if (item.author.id === this.$store.state.auth.user.uuid) {
const itemPayload = ObjectUtil.merge({}, payload)
itemPayload.uuid = item.uuid
if (itemPayload.id) itemPayload.id = item.id
await this.$store.dispatch(action, itemPayload)
await this.setRelatedACLForTarget(item.id, action, itemPayload)
}
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment