stash
This commit is contained in:
parent
6ee5ae38b1
commit
9685b4020e
11 changed files with 331 additions and 268 deletions
|
|
@ -98,16 +98,12 @@ export default {
|
|||
decodedHandle() {
|
||||
return decodeHandleFromUrl(this.handle)
|
||||
},
|
||||
// Am I a member of this group, hosted here (groupIdByHandle, from idmap) or elsewhere
|
||||
// (groupMemberships - see GroupMembership/docs/design-in-progress/groups-mvp.md)? Either
|
||||
// way the backend actually hosting the group is what authorizes the write - this is just
|
||||
// enough of a client-side hint to show/hide the buttons for it.
|
||||
// Client-side hint only; the backend hosting the group is what actually authorizes the write. See docs/implementation.md#group-membership-is-recorded-on-both-sides-like-friendship.
|
||||
isGroupMember() {
|
||||
return this.decodedHandle in this.groupIdByHandle
|
||||
|| this.groupMemberships.some(m => m.handle === this.decodedHandle)
|
||||
},
|
||||
// Edit/Delete require actual authorization (own item or member group), not just view
|
||||
// access - get_shared_item's friends_or_self() lets a friend view but never act.
|
||||
// Edit/Delete require actual authorization; get_queryset()'s friends_or_self() lets a friend view but never act. See docs/implementation.md#owner-handle-scoped-routes.
|
||||
canEdit() {
|
||||
return this.decodedHandle === this.user || this.isGroupMember
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue