[Security] : Replace Client-Side Hardcoded Admin Authorization with Server-Enforced Access Control#165
Open
hrshjswniii wants to merge 1 commit into
Open
Conversation
…erver-Enforced Access Control
👷 Deploy request for safevoiceforwomen pending review.Visit the deploys page to approve it
|
Owner
When I log in using these three specific email accounts, I can access the Admin Dashboard, which is used to manage NGO and stories. In your implementation, where have you configured or added these admin email addresses? Also, there is no need to add Firestore security rules in the PR, as those rules are already configured in the Firestore console. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#Program
GssoC'26🏷️ PR Type
Type of PR (check one):
🔗 Related Issue
📝 Rationale / Motivation
firestore.rules).adminsFirestore collection where the Document ID is the administrator's lowercase email.✨ Description of Changes
Summarize changes with details:
src/components/Navbar.tsxrefactored: Removed the hardcodedADMIN_EMAILSarray and checked dynamic administrative credentials from theadminscollection on authentication change.src/pages/Resources.tsxrefactored: RemovedADMIN_EMAILSarray and checked dynamic credentials to toggle partner deletion access.src/pages/AdminDashboard.tsxrefactored: RemovedADMIN_EMAILSand enforced dynamic collection check. Renders an "Access Denied" view if the signed-in user lacks administrator records.firestore.rulesdefining access rules for all database collections (admins,profiles,stories,reactions,reports,ngos,ngo_requests,testimonials).adminsdatabase collection.🧪 Testing Instructions
Step-by-step guide to test this PR:
npm install.adminscollection (Document ID: lowercase email)./adminrenders "Access Denied", and write operations are blocked.PERMISSION_DENIEDon database operations.npm run build) to ensure TypeScript compilation passes.👀 Impact Assessment
Analyze the impact of this PR:
firestore.rules.getDoccall is triggered upon login/auth state updates.⚡ Checklist