RFC: unify common checks for user's permissions
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.2k
- Forks
- 587
- Avg merge
- 18h 27m
- Merged PRs (30d)
- 333
Description
Aim is to unify following checks for user permissions (in advance, before moving to Vue 3 + Pinia):
isModerator, canModerate, isParticipantTypeModerator, isModeratorOrUser, isModeratorOrOwner, e.t.c. => usually a checking for this.$store.getters.conversation(this.token).participantType
isUser, isUserActor, isGuest, currentActorIsAuthor => checking for this.$store.getters.getActorType
return x.actorId === this.$store.getters.getActorId() && x.actorType === this.$store.getters.getActorType()
Maybe a getter? I tried to implement it, as
selfIsActor, and it shows itself pretty good. Though we have a different checks in different places for this, so should be unified first
Originally posted by @Antreesy in https://github.com/nextcloud/spreed/pull/9815#discussion_r1234517011
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the named permission checks and the Vuex getters for conversation participant type, actor type, and actor ID. Review how the checks differ across the frontend, then establish a consistent approach whose completion means the listed checks use unified permission logic before the Vue 3 and Pinia migration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100