Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
GraphQL API: Add password_change_allowed to SiteConfig (#2857)
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre authored Jun 20, 2024
1 parent 96daf31 commit 121966c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
8 changes: 6 additions & 2 deletions crates/handlers/src/graphql/model/site_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ pub struct SiteConfig {
/// Imprint to show in the footer.
imprint: Option<String>,

/// Whether user can change their email.
/// Whether users can change their email.
email_change_allowed: bool,

/// Whether user can change their display name.
/// Whether users can change their display name.
display_name_change_allowed: bool,

/// Whether passwords are enabled and users can change their own passwords.
password_change_allowed: bool,
}

#[ComplexObject]
Expand All @@ -60,6 +63,7 @@ impl SiteConfig {
imprint: data_model.imprint.clone(),
email_change_allowed: data_model.email_change_allowed,
display_name_change_allowed: data_model.displayname_change_allowed,
password_change_allowed: data_model.password_change_allowed,
}
}
}
8 changes: 6 additions & 2 deletions frontend/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1341,14 +1341,18 @@ type SiteConfig implements Node {
"""
imprint: String
"""
Whether user can change their email.
Whether users can change their email.
"""
emailChangeAllowed: Boolean!
"""
Whether user can change their display name.
Whether users can change their display name.
"""
displayNameChangeAllowed: Boolean!
"""
Whether passwords are enabled and users can change their own passwords.
"""
passwordChangeAllowed: Boolean!
"""
The ID of the site configuration.
"""
id: ID!
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,14 +997,16 @@ export enum SetPrimaryEmailStatus {

export type SiteConfig = Node & {
__typename?: 'SiteConfig';
/** Whether user can change their display name. */
/** Whether users can change their display name. */
displayNameChangeAllowed: Scalars['Boolean']['output'];
/** Whether user can change their email. */
/** Whether users can change their email. */
emailChangeAllowed: Scalars['Boolean']['output'];
/** The ID of the site configuration. */
id: Scalars['ID']['output'];
/** Imprint to show in the footer. */
imprint?: Maybe<Scalars['String']['output']>;
/** Whether passwords are enabled and users can change their own passwords. */
passwordChangeAllowed: Scalars['Boolean']['output'];
/** The URL to the privacy policy. */
policyUri?: Maybe<Scalars['Url']['output']>;
/** The server name of the homeserver. */
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/gql/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,17 @@ export default {
},
"args": []
},
{
"name": "passwordChangeAllowed",
"type": {
"kind": "NON_NULL",
"ofType": {
"kind": "SCALAR",
"name": "Any"
}
},
"args": []
},
{
"name": "policyUri",
"type": {
Expand Down

0 comments on commit 121966c

Please sign in to comment.