[Feature]: Better Roles and Permissions System for Groups

Open
#5,077 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
haskell
Domain
authorization

Research direction

No files, tests, or entry points are named. First locate the existing group membership and permission logic, then clarify which role and permission subset is in scope; done requires an agreed design plus implementation and tests for the selected rules.

Written by the indexing model from the issue text.

Description

enhancement
Is there an existing issue for this?
  • I have searched the existing issues
Platform

all

App version

No response

Feature

The current system is pretty limited and since support for bigger communities is planned I am hoping to see a more robust permission system.
The following is my suggestion on how it could be handled.

Roles:

  • The pre-set default roles are Observer, Member, Admin, Owner
  • Users with the required permission can add, remove, and change the current roles
  • At least one role must always exist for each group
  • Each user must always belong to one role and it is not possible to hold multiple roles, because I do not think the system needs to be in-depth enough to handle inheritance
  • Users with the required permission can assign users to new roles (provided the user's priority is higher than the target user's)
  • Each role has a priority level (eg observer 1, member 5, admin 10, owner 50), which decides whether the user can enforce certain changes on another user like changing their role.
  • Consider: should the owner role always have the highest priority and have the permission to change roles hardcoded?

Permissions:

  • Each role has a list of defined permissions.
  • For simplicity the permission system should only be positive, so no subtractive permissions.
  • Potential permissions could be:
  • send_messages
  • send_images
  • send_videos
  • send_files
  • send_audio
  • send_disappearing_messages
  • send_direct_messages
  • delete_message_for_everyone
  • react_to_messages
  • pin_message
  • edit_message
  • view_history_before_joining (100 last messages)
  • view_messages (something that normally every member would have, but by not giving it to a role you could create a simple way for users to anonymously drop off feedback into a publicly accessible group with only the owners seeing it, and it becomes even more useful if communities get multiple channels with the ability to limit permissions per-channel)
  • view_images
  • view_videos
  • view_files
  • view_audio
  • change_group_name
  • change_group_description
  • change_group_image
  • change_group_welcome_message
  • change_group_roles
  • assign_role
  • etc

If communities with multiple channels are added then a normal permission could count for all channels, while a permission like "view_messages#private" could permit viewing the private channel.
Though it would have to be kept in mind that in order for only that role to be able to see the private channel messages, none of the other roles must have the "view_messages" permission and instead each #channelname permission would have to be added manually for every role.
A permission system that has a concept of a "default" and supports both positive as well as negative permissions would be easier to adjust, but probably more difficult to implement.

Will something like this be added in the future?

Dominant language
Haskell
Stars
19.5k
Forks
1.4k
Avg merge
1d 20h
Merged PRs (30d)
71

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.

More from simplex-chat/simplex-chat

All issues in simplex-chat/simplex-chat

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.