Skip to content

Commit 91ca0b3

Browse files
committed
refactor(app): update AppBloc to handle user roles list
This refactors the AppBloc's user change handler to correctly evaluate dashboard access based on the user.roles list instead of a singular role property. The logic now checks for 'admin' or 'publisher' roles to grant authenticated status. It also corrects the condition for fetching user settings to depend on this authenticated status, not just the presence of a user object.
1 parent 7fd9f18 commit 91ca0b3

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/app_configuration/view/app_configuration_page.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> {
282282
horizontal: AppSpacing.xxl,
283283
),
284284
children: [
285-
_UserPreferenceLimitsForm(refactor(app_configuration): use UserRoles string constants
286-
287-
This change refactors the AppConfigurationPage and its helper form widgets to use string-based role constants from the `UserRoles` class instead of an obsolete `UserRole` enum.
288-
289-
This aligns the UI with the updated `User` model, which represents roles as a list of strings, ensuring consistency across the application.
290-
285+
_UserPreferenceLimitsForm(
291286
userRole: UserRoles.guestUser,
292287
appConfig: appConfig,
293288
onConfigChanged: (newConfig) {

0 commit comments

Comments
 (0)