You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thread freezing is necessary to prevent any further modifications to a specific thread upon meeting freezing criteria or as determined by CommonDAO. This includes editing its content, adding replies, flagging, or deleting it. Once frozen, the thread should be immutable regardless of any existing permissions. Only users with the freeze privilege may reverse this state by unfreezing the thread.
Extends the Thread struct (or the Post struct when representing top-level posts) to include a Frozen boolean field.
Example
typeThreadstruct {
ThreadIDstringTitlestringAuthorAddressContentstringTimestamp time.TimeFlags []FlagFrozenbool// indicates whether the thread is frozen// ... other fields
}
Implements a FreezeThread(boardID BoardID, threadID PostID) function that:
Verifies that the thread is not already frozen.
Checks that the caller has the required freeze permission (e.g., PermissionThreadFreeze).
Sets the thread's Frozen flag to true, effectively blocking all modifications.
Creates an UnfreezeThread(boardID BoardID, threadID PostID) function that:
Validates that the thread is currently frozen.
Verifies that the caller holds the freeze/unfreeze permission.
Sets the Frozen flag to false.
Overrides Existing Permissions
Once a thread is frozen, all modifying actions (editing, replying, flagging, deleting, etc.) are blocked—even if the caller would normally be allowed to perform these actions.
Relevant functions (e.g., EditThread, DeleteThread, FlagThread) include a check for thread.Frozen and reject modifications if set.
Tests
Verifies that freezing a thread prevents any modifications.
Confirms that only authorized users (those with freeze permissions) can freeze or unfreeze a thread.
-Attempting to freeze an already frozen thread results in an error.
Validates that once unfrozen, the thread can again be modified as normal.
The text was updated successfully, but these errors were encountered:
Context:
Thread freezing is necessary to prevent any further modifications to a specific thread upon meeting freezing criteria or as determined by CommonDAO. This includes editing its content, adding replies, flagging, or deleting it. Once frozen, the thread should be immutable regardless of any existing permissions. Only users with the freeze privilege may reverse this state by unfreezing the thread.
Follows: #3755
Related to: #3820
Acceptance Criteria:
Extends the
Thread
struct (or thePost
struct when representing top-level posts) to include aFrozen
boolean field.Example
Implements a
FreezeThread(boardID BoardID, threadID PostID)
function that:PermissionThreadFreeze
).Frozen
flag totrue
, effectively blocking all modifications.Example
Creates an
UnfreezeThread(boardID BoardID, threadID PostID)
function that:Frozen
flag tofalse
.Overrides Existing Permissions
EditThread
,DeleteThread
,FlagThread
) include a check forthread.Frozen
and reject modifications if set.Tests
-Attempting to freeze an already frozen thread results in an error.
The text was updated successfully, but these errors were encountered: