Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement restrict email settings configuration to Admin #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Amenu-sh
Copy link
Collaborator

@Amenu-sh Amenu-sh commented Sep 27, 2024

Ticket

ID: #13
Link:https://project-ascend-io.atlassian.net/browse/PAP-209

Problem

Admin and non-admin users can view, edit, and configure email settings, violating the intended access controls.

Solution

Access controls have been implemented to restrict non-admin users. Only admin users will have full access to view, edit, and configure email settings, while non-admin users will have view-only permissions.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • This change requires a documentation update

How Has This Been Tested?

The solution was tested locally by logging in with different user roles, both as an admin and a non-admin, to verify access restrictions and ensure that only admin users have full access to email settings.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
Screenshot 2024-10-22 at 10 05 13 PM

oestrada1001
oestrada1001 previously approved these changes Oct 19, 2024
} catch (error: any) {
console.error("Error fetching email settings:", error);
// If user is an admin, fetch email settings
if (user.role === "Admin") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This definitely works for now. As we continue to add more roles this will become cumbersome.

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