Skip to content

Commit ecd8f57

Browse files
committed
feat(rbac): define permissions for ugc
Introduces new permission constants for managing user-generated content. This includes permissions for creating, reading, updating, and deleting engagements and reports, scoped to the owner. These permissions are essential for securing the new UGC endpoints and ensuring users can only manage their own content.
1 parent a34b1e6 commit ecd8f57

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/src/rbac/permissions.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,24 @@ abstract class Permissions {
103103
/// Allows deleting the user's own in-app notifications.
104104
static const String inAppNotificationDeleteOwned =
105105
'in_app_notification.delete_owned';
106+
107+
// Engagement Permissions (User-owned)
108+
/// Allows creating an engagement (reaction or comment).
109+
static const String engagementCreateOwned = 'engagement.create_owned';
110+
111+
/// Allows reading the user's own engagements.
112+
static const String engagementReadOwned = 'engagement.read_owned';
113+
114+
/// Allows updating the user's own engagement (e.g., changing a reaction).
115+
static const String engagementUpdateOwned = 'engagement.update_owned';
116+
117+
/// Allows deleting the user's own engagement.
118+
static const String engagementDeleteOwned = 'engagement.delete_owned';
119+
120+
// Report Permissions (User-owned)
121+
/// Allows creating a report.
122+
static const String reportCreateOwned = 'report.create_owned';
123+
124+
/// Allows reading the user's own reports.
125+
static const String reportReadOwned = 'report.read_owned';
106126
}

0 commit comments

Comments
 (0)