nextcloud / nextcloud/spreed

RFC: unify common checks for user's permissions

Open
#9,817 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature: frontend 🖌️ technical debt
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.