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 new role access #20

Merged
merged 3 commits into from
Sep 15, 2024
Merged

Conversation

SasinduNanayakkara
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
bashaway-admin-portal ⬜️ Ignored (Inspect) Visit Preview Sep 15, 2024 0:34am

@SasinduNanayakkara SasinduNanayakkara linked an issue Sep 1, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Sep 1, 2024

PR Preview Action v1.1.1-2-g04886b2
🛫 Deployed preview to https://admin.staging.bashaway.sliitfoss.org/preview/pr-20/
on branch gh-pages at 2024-09-04 16:56 UTC

Copy link
Member

@Akalanka47000 Akalanka47000 left a comment

Choose a reason for hiding this comment

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

There are other places which must be hidden as well, submission grading, question add, user add etc for spectators

Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this and switch to pnpm

>
Edit
</Button>
{localStorage.getItem("role") == "ADMIN" ? (
Copy link
Member

Choose a reason for hiding this comment

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

Let's not rely on localstorage for this and use the profile from RTK Query

loading={isLoading}
loaderProps={{ width: 16, height: 16 }}
/>
{localStorage.getItem("role") == "ADMIN" ? (
Copy link
Member

Choose a reason for hiding this comment

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

Let's not rely on localstorage for this and use the profile from RTK Query

@@ -20,6 +20,7 @@ export const authApi = createApi({
} else {
localStorage.setItem("access_token", response.data.access_token);
localStorage.setItem("refresh_token", response.data.refresh_token);
localStorage.setItem("role", response.data.user.role);
Copy link
Member

Choose a reason for hiding this comment

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

We don't need this, we already have the user info with us in the access token which also is used to retrieve and set to the state

@Akalanka47000 Akalanka47000 merged commit 6220cfa into development Sep 15, 2024
6 checks passed
@Akalanka47000 Akalanka47000 deleted the feature/addNewRole branch September 15, 2024 12:39
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.

Introduce new "SPECTATOR" role
2 participants