-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Controlled accounts
Is your feature request related to a problem? Please describe.
Companies, schools and parents would like ability to white- and black- list certain users in certain guilds, channels and user use of this feature.
Describe the solution you'd like
- Group whitelist/blacklist create (list of guilds and DM targets)
- Group whitelist/blacklist fetch
- Group whitelist/blacklist delete
- Discriminator step-reserve
- Discriminator range unreserve
- Create controlled account (🔗 Admin API/Controlled accounts route: POST /users/ #109)
- Delete controlled account (DELETE /users/:id endpoint - see detailed description below)
- Fetch all accounts controlled by self
- Apply group whitelist/blacklist to controlled user
- Action in behalf of controlled user
Detailed description of the endpoints
Create controlled account: This endpoint shall create a controlled user account.
Parameters:
username: Name of the controlled accounttag: Discriminator of the controlled accountscope: Array of group whitelist/blacklists to apply (if both white- and blacklists are present, then blacklist is subtracted from the whitelist)controller: The user who controls the account (implicit in writes, returned in reads of the controlled user)rights: Initial rights of the user
Returns: If unauthorized to create a controlled user or apply one or more of the control flags, return 403 Forbidden.
Otherwise, return 200 OK.
Delete controlled account: This endpoint shall remove a controlled user account. Anticensor provides two deletion methods:
POST /users/:id/delete - Regular invalidate & delete (like POST /users/@me/delete, but acting on others)
- Obeys retention policies
- Requires
ACCOUNT_CONTROLLERorMANAGE_USERSpermissions - Permissions: A user with
ACCOUNT_CONTROLLERcan only delete an account within its own control group. A user withMANAGE_USERScan delete any user.
DELETE /users/:id - Right-to-erasure route (like DELETE /users/@me, but acting on others)
- Deletes everything created by the user
- Requires
ACCOUNT_CONTROLLERorMANAGE_USERSpermissions - Permissions: A user with
ACCOUNT_CONTROLLERcan only delete an account within its own control group. A user withMANAGE_USERScan delete any user.
Returns: If the user does not exist, return 400 Bad Request. If the requesting user does not have the permission, then return 403 Forbidden.
Group white- and blacklist objects:
Parameters:
whitelist: iftrue, a whitelist, else, a blacklistguilds: list of guildsusers: list of DM targetsroles: list of roles
If unauthorized to create a controlled user or apply one or more of the control flags, return 403 Forbidden.
On success, return 200 OK.
Group whitelist/blacklist create:
users: Array of user IDs to be affected initiallyscope: Group whitelist/blacklist object
If unauthorized to create a controlled user or apply one or more of the control flags, return 403 Forbidden.
On success, return 200 OK.
Discriminator range reserve: Reserve certain discriminators for a certain account controller. An account controller can only reserve discriminators for itself, not for other controllers.
Parameters:
include: a pair of discriminators, which denote an inclusive rangeexclude: array of pairs of discriminators, which denote ranges to be excluded from above
If unauthorized to create a controlled user or apply one or more of the control flags, return 403 Forbidden.
On success, return 200 OK.
Discriminator range fetch: Returns the reservation by reservation ID. Discriminator range reservations shall be returnable by any user.
If unauthorized to create the reservation or attempts to re-reserve an already reserved range, return 403 Forbidden.
On success, return 200 OK.
Discriminator range delete: Deletes the reservation by reservation ID. Only the user that created the reservation can delete it.
If unauthorized to unreserve the range, return 403 Forbidden. On attempt to delete a non-existent reservation, return 400 Bad Request.
On success, return 200 OK.