Skip to content

Add option to limit community creation to admins only (fixes #1586)#1587

Merged
dessalines merged 2 commits intomainfrom
feature/1586-only-admins-create-community
Apr 22, 2021
Merged

Add option to limit community creation to admins only (fixes #1586)#1587
dessalines merged 2 commits intomainfrom
feature/1586-only-admins-create-community

Conversation

@Nutomic
Copy link
Copy Markdown
Member

@Nutomic Nutomic commented Apr 20, 2021

Quite easy to implement, and its something that has been requested a lot. Maybe the variable could have a better name.

Comment thread migrations/2021-04-20-155001_limit-admins-create-community/up.sql Outdated
Comment thread crates/api_common/src/site.rs
Comment thread crates/api_common/src/site.rs

let site = blocking(context.pool(), move |conn| Site::read(conn, 0)).await??;
if site.community_creation_admin_only && is_admin(&local_user_view).is_err() {
return Err(ApiError::err("only_admins_can_create_communities").into());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add this to lemmy-translations

Comment on lines 72 to +75
pub open_registration: bool,
pub enable_nsfw: bool,
pub auth: String,
pub community_creation_admin_only: bool,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side point, but since all of these have defaults, I can probably make them optional.

@Nutomic
Copy link
Copy Markdown
Member Author

Nutomic commented Apr 22, 2021

Updated.

@dessalines dessalines merged commit db1abff into main Apr 22, 2021
@Nothing4You Nothing4You deleted the feature/1586-only-admins-create-community branch September 11, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants