Skip to content

[feature]: Allow non-admin users to access import settings#353

Open
deeonwuli wants to merge 1 commit into
developmentfrom
feat/make-settings-dialog-accessible-to-non-admin
Open

[feature]: Allow non-admin users to access import settings#353
deeonwuli wants to merge 1 commit into
developmentfrom
feat/make-settings-dialog-accessible-to-non-admin

Conversation

@deeonwuli

Copy link
Copy Markdown
Contributor

📌 References

📝 Implementation

Adds a new importSettingsAccess permission field to AppSettings (stored in the user-extended-app-settings constant). Non-admin users listed in this field can open the settings dialog and see only the Import tab, without access to the rest of the settings.

  • New CheckCurrentUserCanAccessImportSettingsUseCase checks: super admin, full settings access, or import-only access
  • Settings gear icon is shown if the user qualifies for either access level
  • Admin can configure import access via Settings → Permissions → "Access to Import Settings"

📹 Screenshots/Screen capture

Screenshot 2026-06-15 at 08 22 43

🔥 Testing

  1. As admin, go to Settings → Permissions → enable "Access to Import Settings" and add a user/group
  2. Log in as that user — gear icon is visible, clicking it shows only the Import tab
  3. A user in neither list sees no gear icon

#869dn72ua

@bundlemon

bundlemon Bot commented Jun 15, 2026

Copy link
Copy Markdown

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
Build Folder
./**/*
1.41MB (+851B +0.06%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@deeonwuli deeonwuli requested review from MiquelAdell and eperedo June 16, 2026 11:20
@deeonwuli deeonwuli marked this pull request as ready for review June 16, 2026 11:20
Comment thread i18n/fr.po
"Les modifications sur 'Qui a accès' aux paramètres seront prises en compte "
"après le rechargement de la page"

#, fuzzy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the fuzzy translations? Here, but also for PT and PT_BR

.run(setCurrentUserHasAccessToImportSettings, console.error);
}, [compositionRoot.users]);

const showSettingsIcon = currentUserHasAccessToSettings || currentUserHasAccessToImportSettings;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this change. This means that users who have access to the import action can now open the 'settings' modal and configure any permission. This was not part of the task, so maybe we should stick to the previous logic?

userGroupIds: user.userGroups.map(getId),
};

return (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole usecase is ok, but this is almost the same logic we have in CheckCurrentUserCanAccessSettingsUseCase.ts. I think we can have only one usecase and instead returning a boolean we can return a new type:

type UserSettingsAccess = {
  accessToSettings: boolean;
  accessToImport: boolean;
}

and now we can centralize every access logic in this usecase so in the future we don't need one usecase for every new setting and also we save hitting the server with the same two requests to get the current user and the appsettings. Does this make sense? What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants