Skip to content

Commit e6fb40d

Browse files
committed
feat(rbac): expand role permissions for guest users and dashboard publishers
- Add languageRead permission to guest users - Extend dashboard publisher permissions to include: - Additional content type read permissions (headline, topic, source, country, language, remoteConfig) - Create, update, and delete language permissions - Improve code readability with better commenting
1 parent 347c5c7 commit e6fb40d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/src/rbac/role_permissions.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final Set<String> _appGuestUserPermissions = {
88
Permissions.topicRead,
99
Permissions.sourceRead,
1010
Permissions.countryRead,
11+
Permissions.languageRead,
1112
Permissions.userAppSettingsReadOwned,
1213
Permissions.userAppSettingsUpdateOwned,
1314
Permissions.userContentPreferencesReadOwned,
@@ -30,9 +31,20 @@ final Set<String> _appPremiumUserPermissions = {
3031
// --- Dashboard Role Permissions ---
3132

3233
final Set<String> _dashboardPublisherPermissions = {
34+
// Publishers need to read all content types to manage them effectively.
35+
Permissions.headlineRead,
36+
Permissions.topicRead,
37+
Permissions.sourceRead,
38+
Permissions.countryRead,
39+
Permissions.languageRead,
40+
Permissions.remoteConfigRead,
41+
42+
// Publishers can manage headlines.
3343
Permissions.headlineCreate,
3444
Permissions.headlineUpdate,
3545
Permissions.headlineDelete,
46+
47+
// Core dashboard access and quality-of-life permissions.
3648
Permissions.dashboardLogin,
3749
Permissions.rateLimitingBypass,
3850
};
@@ -48,6 +60,9 @@ final Set<String> _dashboardAdminPermissions = {
4860
Permissions.countryCreate,
4961
Permissions.countryUpdate,
5062
Permissions.countryDelete,
63+
Permissions.languageCreate,
64+
Permissions.languageUpdate,
65+
Permissions.languageDelete,
5166
Permissions.userRead, // Allows reading any user's profile
5267
Permissions.remoteConfigCreate,
5368
Permissions.remoteConfigUpdate,

0 commit comments

Comments
 (0)