-
Notifications
You must be signed in to change notification settings - Fork 481
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
Display live monitoring button to only State Admin, District Admin and Doctor. #7029
Conversation
👷 Deploy Preview for care-egov-staging processing.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@rithviknishad can u review once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just hides the button. Users could still go to the URL directly and open the page right?
I think we could add a reusable component called: AuthorizedRoute
which accepts user_type: UserRole[]; children
and show Page Not Found / Forbidden if unauthorized, else the children.
This wrapper would be used directly in the raviger router's routes like:
const routes = {
...
"/path/to/page": (props) => (
<AuthorizedRoute userTypes={["StateAdmin", ...]}>
<LiveMonitoring {...props} />
</AuthorizedRoute>
)
};
@rithviknishad is this okay ? |
LGTM |
@AshrafMd-1 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌. |
Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist