ContentModerationHelper class
Shared content moderation utility for admin/editor actions. Used by neom_books and neom_audio_player for suspend/delete operations.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
applyChangeApproval(
AppRequest request) → Future< bool> - Applies an approved change request to its target entity. Returns true on success. Currently handles 'releaseItem'; other target types (e.g. ERP) are handled by their own modules.
-
canApplyDirectly(
UserRole role) → bool -
Whether
rolecan apply sensitive changes directly (admin+). -
canModerate(
UserRole role) → bool - Returns true if the given role has moderation privileges (editor+).
-
canRequestChange(
UserRole role) → bool -
Whether
rolemay propose changes that require approval (above subscriber, i.e. editor and up, but below admin who applies directly). -
deleteMediaItem(
AppMediaItem item) → Future< bool> - Permanently deletes an AppMediaItem from Firestore.
-
deleteReleaseItem(
AppReleaseItem item) → Future< bool> - Permanently deletes an AppReleaseItem from Firestore.
-
deleteReleaseItemWithOwnerCleanup(
AppReleaseItem item) → Future< bool> -
Permanently deletes an AppReleaseItem and cleans up every embedded
reference held by the owner (resolved via
AppReleaseItem.ownerEmail). -
showDeleteContentDialog(
BuildContext context, {required String contentName, required Future< bool> onConfirm()}) → Future<void> -
Shows delete confirmation dialog.
Calls
onConfirmif user confirms the permanent deletion. -
showSuspendContentDialog(
BuildContext context, {required String contentName, required Future< bool> onConfirm(String? reason)}) → Future<void> -
Shows suspend confirmation dialog with optional reason field.
Calls
onConfirmwith the reason text if user confirms. -
submitReleaseEditApproval(
{required String requesterProfileId, required String releaseItemId, required String releaseName, required Map< String, dynamic> changes}) → Future<String> - Submits a change-approval request for an AppReleaseItem edit that the requester is allowed to propose but not apply directly. Returns the new request id (empty on failure).
-
suspendMediaItem(
String mediaItemId, String moderatorId, {String? reason}) → Future< bool> - Suspends an AppMediaItem (sets isSuspended=true with audit fields).
-
suspendReleaseItem(
String releaseItemId, String moderatorId, {String? reason}) → Future< bool> - Suspends an AppReleaseItem (sets isSuspended=true with audit fields).
-
unsuspendMediaItem(
String mediaItemId) → Future< bool> - Unsuspends an AppMediaItem (reverses suspension).
-
unsuspendReleaseItem(
String releaseItemId) → Future< bool> - Unsuspends an AppReleaseItem (reverses suspension).
-
updateReleaseItemMetadata(
String releaseItemId, {String? name, String? description, String? imgUrl, String? ownerName, List< String> ? categories, String? language, int? duration}) → Future<bool> - Updates editable metadata of an AppReleaseItem (title, description, cover, author display name, categories, language, pages). Only the non-null arguments are written. Used by admin/editor edit flows so a published work can be corrected without re-running the upload wizard.