This commit is contained in:
Price Hiller 2024-02-09 13:26:32 -06:00
parent f9bcc11bab
commit 450435a9ca
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8

View File

@ -1,6 +1,18 @@
#+OPTIONS: H:99 ^:nil
* Squad Whitelist Management
** As a ...
*** Admin
- Someone who administrates the actual whitelisting service
-
*** Organization Owner/Admin
- Someone who runs a Squad community, like Asgard Eternal
- What should they be able to do?
** Discord Bot
@ -35,10 +47,12 @@
- Hit up API for all members of linked roles
- Check if the members are in those roles and modify as needed
** Data
** API
*** General Layout
- Org
- Tags
- Single Owner
- All permissions Managers have
- Org Perms
@ -62,16 +76,20 @@
- Create
- Rename
- Groups
- Group: whitelist-{group-id}
- Group
- Notes
- Members
- Group Perms
- Manage Users (Add or Remove Users)
- Manage Moderators (Allow other users to manage the group)
- Manage Remote Import (Allowed to set a remote import)
- This does not use the perms from the remote import, only pulls the members from the remote import list
- This does not use the perms from the remote import, only pulls the members from
the remote import list
- Can specify a group in the remote (only pull members in that remote admin list)
- Owner (All group perms)
- Owner
- There may be only one owner of a group, by default it is whoever created the group
- Has all group permissions, cannot be removed from the group by non-org managers or
instance admins
- Tags
- Must be a tag that exists in the Org (reference a tag table)
- Game Perms
@ -85,11 +103,13 @@
*** Users
- Table Name: =users=
| Key | Type | Constraints | Description |
|--------------|-----------|--------------------------|-------------|
| =id= | ~DECIMAL~ | ~PRIMARY KEY~ | Steam64 |
| =discord_id= | ~DECIMAL~ | ~UNIQUE~ | |
| =superuser= | ~BOOLEAN~ | ~NOT NULL DEFAULT false~ | |
| Key | Type | Constraints | Description |
|--------------|-----------|--------------------------|-------------------|
| =id= | ~UUID4~ | ~PRIMARY KEY~ | |
| =steam64= | ~DECIMAL~ | ~UNIQUE~ | Steam64 ID |
| =playfab_id= | ~TEXT~ | ~UNIQUE~ | Master Playfab ID |
| =discord_id= | ~DECIMAL~ | ~UNIQUE~ | |
| =superuser= | ~BOOLEAN~ | ~NOT NULL DEFAULT false~ | |
*** Organizations
@ -161,12 +181,15 @@
***** Group Members
- Table Name: =org_group_members=
| Key | Type | Constraints | Description |
|------------|-----------|-----------------------------------------------|-------------|
| =id= | ~UUID4~ | ~PRIMARY KEY~ | |
| =user_id= | ~DECIMAL~ | ~REFERENCES users(id) ON DELETE CASCADE~ | |
| =group_id= | ~UUID4~ | ~REFERENCES org_groups(id) ON DELETE CASCADE~ | |
| =owner= | ~BOOLEAN~ | ~NOT NULL DEFAULT false~ | |
| Key | Type | Constraints | Description |
|------------------------|-----------|-----------------------------------------------|----------------------------------------------------------------------|
| =id= | ~UUID4~ | ~PRIMARY KEY~ | |
| =user_id= | ~DECIMAL~ | ~REFERENCES users(id) ON DELETE CASCADE~ | |
| =group_id= | ~UUID4~ | ~REFERENCES org_groups(id) ON DELETE CASCADE~ | |
| =manage_users= | ~BOOLEAN~ | ~NOT NULL DEFAULT false~ | Allowed to add or remove members from group |
| =manage_mods= | ~BOOLEAN~ | ~NOT NULL DEFAULT false~ | Allowed to add or remove moderators to group |
| =manage_remote_import= | ~BOOLEAN~ | ~NOT NULL DEFAULT false~ | Allowed to set URL to import members from |
| =owner= | ~BOOLEAN~ | ~NOT NULL DEFAULT false UNIQUE~ | Has all permissions, cannot be removed from the group by a moderator |
- Additional Constraints
- ~UNIQUE (user_id, group_id)~