Summary
Adds the ability to configure custom (granular) deletion policies for posts for specific teams and/or channels so that when . When the daily retention job runs it can selectively delete those deletes posts by age based on the configuration.
The retention job (or at least the queries) will have to be modified such that the global setting does not delete posts for any team or channel that is configured via granular policies . The granular policies completely override the global setting. Put differently, granular setting can either cause a post to live longer or shorter than the global setting.
The feature requires some new APIs, some new tables, and an edit to the existing data retention job codelogic.
API
Global Policy (existing API)
...
Code Block |
---|
{ "message_deletion_enabled": false, "file_deletion_enabled": false, "message_retention_cutoff": 0, "file_retention_cutoff": 0 } |
The JSON object reflects the fields in the DataRetentionSettings
config object for:
EnableMessageDeletion
EnableFileDeletion
MessageRetentionDays
FileRetentionDays
Updates to the global retention policy continues to be managed via the config APIs.
TBD: Does setting EnableMessageDeletion
or EnableFileDeletion
to false
disable all of the policies?
...
Retention Policies
POST /api/v4/retention_policies
create a new retention policy.
...
Column name | Description |
---|---|
| varchar, the RetentionPolicies.Id foreign key |
| varchar, the Teams.Id foreign key |
Model
Rename
DataRetentionPolicy
toGlobalDataRetentionPolicy
Add
RetentionPolicy
Add
RetentionPolicyChannel
Add
RetentionPolicyTeam
Enterprise
Changes to various methods on DataRetentionWorker
in data_retention/worker.go
are required.
Mobile
No changes. Existing file-deleted and post-deleted UX covers all.