com.getorbyt.community.saveRole
Creates a Community role, or changes one. Without a key it creates a role; with one it replaces that role's name and permissions. The key moderator changes what the built-in moderator role may do, and keeps its name. Only an administrator may define roles. Recorded in the moderation log.
Details · procedure
| Kind | procedure |
|---|---|
| Authority | community.getorbyt.com |
| Indexed |
Checks
Validunlimited-stringdefs.main.input.schema.properties.permissions.itemsNo maxLength, maxGraphemes or format limits this string.
{
"$type": "com.atproto.lexicon.schema",
"defs": {
"main": {
"description": "Creates a Community role, or changes one. Without a key it creates a role; with one it replaces that role's name and permissions. The key moderator changes what the built-in moderator role may do, and keeps its name. Only an administrator may define roles. Recorded in the moderation log.",
"errors": [
{
"name": "AuthenticationRequired"
},
{
"name": "CommunityNotFound"
},
{
"name": "InsufficientRole"
},
{
"name": "InvalidRequest"
},
{
"description": "No role with this key exists in the Community.",
"name": "RoleNotFound"
},
{
"description": "The Community already defines the most roles it may.",
"name": "TooManyRoles"
}
],
"input": {
"encoding": "application/json",
"schema": {
"properties": {
"community": {
"format": "at-uri",
"type": "string"
},
"key": {
"description": "The role to change. Absent creates a role.",
"maxLength": 64,
"type": "string"
},
"name": {
"description": "Required for a role the Community defined. Ignored for moderator.",
"maxGraphemes": 32,
"maxLength": 320,
"type": "string"
},
"permissions": {
"items": {
"knownValues": [
"manage-posts",
"manage-reports",
"manage-members",
"manage-roles",
"manage-settings",
"manage-mail",
"view-log"
],
"type": "string"
},
"maxLength": 16,
"type": "array"
}
},
"required": [
"community",
"permissions"
],
"type": "object"
}
},
"output": {
"encoding": "application/json",
"schema": {
"properties": {
"role": {
"ref": "com.getorbyt.community.defs#roleView",
"type": "ref"
}
},
"required": [
"role"
],
"type": "object"
}
},
"type": "procedure"
}
},
"id": "com.getorbyt.community.saveRole",
"lexicon": 1
}