Skip to content

Commit

Permalink
Add !no-unauthenticated imperative label (#1926)
Browse files Browse the repository at this point in the history
* Add !no-logged-out imperative label

* Add profile behavior docs and tests

* Tweak copy

* Prettier pass

* Rename no-logged-out label to no-authenticated
  • Loading branch information
pfrazee authored Dec 6, 2023
1 parent 5038b50 commit cea5189
Show file tree
Hide file tree
Showing 15 changed files with 547 additions and 170 deletions.
6 changes: 6 additions & 0 deletions packages/api/definitions/labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"preferences": ["warn"],
"flags": [],
"onwarn": "blur"
},
{
"id": "!no-unauthenticated",
"preferences": ["hide"],
"flags": ["no-override", "unauthed"],
"onwarn": "blur"
}
]
},
Expand Down
14 changes: 14 additions & 0 deletions packages/api/definitions/locale/en/labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@
"description": "This content has received a general warning from moderators."
}
},
"!no-unauthenticated": {
"settings": {
"name": "Sign-in Required",
"description": "This user has requested that their account only be shown to signed-in users."
},
"account": {
"name": "Sign-in Required",
"description": "This user has requested that their account only be shown to signed-in users."
},
"content": {
"name": "Sign-in Required",
"description": "This user has requested that their content only be shown to signed-in users."
}
},
"dmca-violation": {
"settings": {
"name": "Copyright Violation",
Expand Down
1 change: 1 addition & 0 deletions packages/api/definitions/moderation-behaviors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface ModerationBehaviors {
configurations: Record<
string,
{
authed?: boolean
adultContentEnabled: boolean
settings: Record<string, LabelPreference>
}
Expand Down
118 changes: 118 additions & 0 deletions packages/api/definitions/post-moderation-behaviors.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"porn-warn-intolerant-hide": {
"adultContentEnabled": true,
"settings": { "porn": "warn", "intolerant": "hide" }
},
"logged-out": {
"authed": false
}
},
"scenarios": {
Expand Down Expand Up @@ -248,6 +251,121 @@
}
},

"Imperative label ('!no-unauthenticated') on post when logged out": {
"cfg": "logged-out",
"subject": "post",
"author": "alice",
"labels": { "post": ["!no-unauthenticated"] },
"behaviors": {
"content": {
"cause": "label:!no-unauthenticated",
"filter": true,
"blur": true,
"noOverride": true
}
}
},
"Imperative label ('!no-unauthenticated') on author profile when logged out": {
"cfg": "logged-out",
"subject": "post",
"author": "alice",
"labels": { "profile": ["!no-unauthenticated"] },
"behaviors": {
"avatar": {
"cause": "label:!no-unauthenticated",
"blur": true,
"noOverride": true
}
}
},
"Imperative label ('!no-unauthenticated') on author account when logged out": {
"cfg": "logged-out",
"subject": "post",
"author": "alice",
"labels": { "account": ["!no-unauthenticated"] },
"behaviors": {
"content": {
"cause": "label:!no-unauthenticated",
"filter": true,
"blur": true,
"noOverride": true
},
"avatar": {
"cause": "label:!no-unauthenticated",
"blur": true,
"noOverride": true
}
}
},
"Imperative label ('!no-unauthenticated') on quoted post when logged out": {
"cfg": "logged-out",
"subject": "post",
"author": "alice",
"quoteAuthor": "alice",
"labels": { "quotedPost": ["!no-unauthenticated"] },
"behaviors": {
"content": { "cause": "label:!no-unauthenticated", "filter": true },
"embed": {
"cause": "label:!no-unauthenticated",
"blur": true,
"noOverride": true
}
}
},
"Imperative label ('!no-unauthenticated') on quoted author account when logged out": {
"cfg": "logged-out",
"subject": "post",
"author": "alice",
"quoteAuthor": "alice",
"labels": { "quotedAccount": ["!no-unauthenticated"] },
"behaviors": {
"content": { "cause": "label:!no-unauthenticated", "filter": true },
"embed": {
"cause": "label:!no-unauthenticated",
"blur": true,
"noOverride": true
}
}
},

"Imperative label ('!no-unauthenticated') on post when logged in": {
"cfg": "none",
"subject": "post",
"author": "alice",
"labels": { "post": ["!no-unauthenticated"] },
"behaviors": {}
},
"Imperative label ('!no-unauthenticated') on author profile when logged in": {
"cfg": "none",
"subject": "post",
"author": "alice",
"labels": { "profile": ["!no-unauthenticated"] },
"behaviors": {}
},
"Imperative label ('!no-unauthenticated') on author account when logged in": {
"cfg": "none",
"subject": "post",
"author": "alice",
"labels": { "account": ["!no-unauthenticated"] },
"behaviors": {}
},
"Imperative label ('!no-unauthenticated') on quoted post when logged in": {
"cfg": "none",
"subject": "post",
"author": "alice",
"quoteAuthor": "alice",
"labels": { "quotedPost": ["!no-unauthenticated"] },
"behaviors": {}
},
"Imperative label ('!no-unauthenticated') on quoted author account when logged in": {
"cfg": "none",
"subject": "post",
"author": "alice",
"quoteAuthor": "alice",
"labels": { "quotedAccount": ["!no-unauthenticated"] },
"behaviors": {}
},

"Blur label ('intolerant') on post (hide)": {
"cfg": "intolerant-hide",
"subject": "post",
Expand Down
48 changes: 48 additions & 0 deletions packages/api/definitions/profile-moderation-behaviors.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
},
"intolerant-hide-scam-warn": {
"settings": { "intolerant": "hide", "scam": "hide" }
},
"logged-out": {
"authed": false
}
},
"scenarios": {
Expand Down Expand Up @@ -161,6 +164,51 @@
}
},

"Imperative label ('!no-unauthenticated') on account when logged out": {
"cfg": "logged-out",
"subject": "profile",
"author": "alice",
"labels": { "account": ["!no-unauthenticated"] },
"behaviors": {
"account": {
"cause": "label:!no-unauthenticated",
"filter": true,
"blur": true,
"noOverride": true
},
"avatar": { "blur": true, "noOverride": true }
}
},
"Imperative label ('!no-unauthenticated') on profile when logged out": {
"cfg": "logged-out",
"subject": "profile",
"author": "alice",
"labels": { "profile": ["!no-unauthenticated"] },
"behaviors": {
"profile": {
"cause": "label:!no-unauthenticated",
"blur": true,
"noOverride": true
},
"avatar": { "blur": true, "noOverride": true }
}
},

"Imperative label ('!no-unauthenticated') on account when logged in": {
"cfg": "none",
"subject": "profile",
"author": "alice",
"labels": { "account": ["!no-unauthenticated"] },
"behaviors": {}
},
"Imperative label ('!no-unauthenticated') on profile when logged in": {
"cfg": "none",
"subject": "profile",
"author": "alice",
"labels": { "profile": ["!no-unauthenticated"] },
"behaviors": {}
},

"Blur label ('intolerant') on account (hide)": {
"cfg": "intolerant-hide",
"subject": "profile",
Expand Down
16 changes: 16 additions & 0 deletions packages/api/docs/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ The kind of UI behavior used when a warning must be applied.
<td></td>
<td>blur</td>
</tr>
<tr>
<td>!no-unauthenticated</td>
<td>system</td>
<td>hide</td>
<td>❌</td>
<td>no-override, unauthed</td>
<td>blur</td>
</tr>
<tr>
<td>dmca-violation</td>
<td>legal</td>
Expand Down Expand Up @@ -343,6 +351,14 @@ The kind of UI behavior used when a warning must be applied.
<code>on content</code><br><strong>Content Warning</strong><br>This content has received a general warning from moderators.<br><br>
</td>
</tr>
<tr>
<td>!no-unauthenticated</td>
<td>
<code>general</code><br><strong>Sign-in Required</strong><br>This user has requested that their account only be shown to signed-in users.<br><br>
<code>on an account</code><br><strong>Sign-in Required</strong><br>This user has requested that their account only be shown to signed-in users.<br><br>
<code>on content</code><br><strong>Sign-in Required</strong><br>This user has requested that their content only be shown to signed-in users.<br><br>
</td>
</tr>
<tr>
<td>dmca-violation</td>
<td>
Expand Down
Loading

0 comments on commit cea5189

Please sign in to comment.