pub struct PersonCommentViewersResource<'a> { /* private fields */ }Expand description
client.person().comment_viewers()
Implementations§
Source§impl<'a> PersonCommentViewersResource<'a>
impl<'a> PersonCommentViewersResource<'a>
Sourcepub fn create(&self, body: &CommentViewerCreate) -> Result<CommentViewer>
pub fn create(&self, body: &CommentViewerCreate) -> Result<CommentViewer>
Create a person-comment visibility category
POST /person/commentviewers
Creates a visibility category for person comments and person-linked notes. Requires edit masterdata in churchdb. name is trimmed and must contain 1–50 characters; duplicate names are allowed. sortKey defaults to 0. The returned category has a generated ID and a translated display name. Creating a category does not assign view comments permissions to any person or role.
§Example
let body = models::CommentViewerCreate {
name: "Pastoral team".into(),
..Default::default()
};
let result = client.person().comment_viewers().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, id: impl Display) -> Result<()>
pub fn delete(&self, id: impl Display) -> Result<()>
Delete a person-comment visibility category
DELETE /person/commentviewers/{id}
Deletes an unused visibility category. Requires edit masterdata in churchdb. Legacy person comments and note links referencing this category block deletion with 409. Successful deletion also removes explicit churchdb view comments assignments for this category and invalidates the permission cache. dry_run=true only checks references and returns 409 with the deletion report even when deletion would be allowed; it never returns 204. A missing category is not explicitly loaded before deletion, so a real delete can return 204 without having removed a row.
Use Self::delete_with to pass query parameters.
§Example
client.person().comment_viewers().delete(1)?;Sourcepub fn delete_with(
&self,
id: impl Display,
query: &DeletePersonCommentviewersIdQuery,
) -> Result<()>
pub fn delete_with( &self, id: impl Display, query: &DeletePersonCommentviewersIdQuery, ) -> Result<()>
Delete a person-comment visibility category
Like Self::delete, with query parameters.
DELETE /person/commentviewers/{id}
Deletes an unused visibility category. Requires edit masterdata in churchdb. Legacy person comments and note links referencing this category block deletion with 409. Successful deletion also removes explicit churchdb view comments assignments for this category and invalidates the permission cache. dry_run=true only checks references and returns 409 with the deletion report even when deletion would be allowed; it never returns 204. A missing category is not explicitly loaded before deletion, so a real delete can return 204 without having removed a row.
Sourcepub fn get(&self, id: impl Display) -> Result<CommentViewer>
pub fn get(&self, id: impl Display) -> Result<CommentViewer>
Get a person-comment visibility category
GET /person/commentviewers/{id}
Returns one category used to classify the visibility of person comments and person-linked notes. Requires authentication; no master-data-edit or view-comments grant for this category is checked. Reading this catalog entry does not authorize reading comments assigned to it. Includes its stored name, translated display name and sort key. Unknown IDs return 404.
§Example
let comment_viewer = client.person().comment_viewers().get(1)?;
println!("{}", comment_viewer.name);Sourcepub fn list(&self) -> Result<Vec<CommentViewer>>
pub fn list(&self) -> Result<Vec<CommentViewer>>
List person-comment visibility categories
GET /person/commentviewers
Lists all configured visibility categories for person comments and person-linked notes. A category is not a user group: assign churchdb view comments for its ID to control who may see matching content, subject to the content endpoint’s additional rules. Requires authentication, but no master-data-edit or per-category view-comments permission is checked here. The catalog is unpaginated and includes categories the caller cannot use to read content. Results are sorted by sortKey, then the stored name, both ascending.
§Example
for comment_viewer in client.person().comment_viewers().list()? {
println!("{}", comment_viewer.name);
}Sourcepub fn update(
&self,
id: impl Display,
body: &CommentViewerUpdate,
) -> Result<CommentViewer>
pub fn update( &self, id: impl Display, body: &CommentViewerUpdate, ) -> Result<CommentViewer>
Update a person-comment visibility category
PUT /person/commentviewers/{id}
Updates a category’s name and optionally its sort key. Requires edit masterdata in churchdb. The ID is taken from the path; no duplicate ID is required in the body. name is required, trimmed to 1–50 characters, and need not be unique. Unlike create, an omitted sortKey preserves the existing value. Explicit null currently passes validation but fails the integer setter, so omit the field to preserve it. Existing comment/note assignments and permission selections keep referencing the same category ID. Unknown IDs return 404.
§Example
let body = models::CommentViewerUpdate {
name: "Pastoral team".into(),
..Default::default()
};
let result = client.person().comment_viewers().update(1, &body)?;
println!("{}", result.name);