这是indexloc提供的服务,不要输入任何密码
Skip to content

Implement Role Management and Validation for User Documents #394

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

Conversation

DennisAlund
Copy link
Member

Description:

This pull request implements role management and validation for user documents in the tanam-documents collection. Key features include:

  • Document ID Validation: Ensures document IDs match Firebase Auth UIDs and removes invalid documents.
  • Admin Role Assignment: Automatically assigns the admin role to the first document written in the collection.
  • Role Management: Updates custom claims with the role when it changes in the document and clears roles from custom claims when a user document is deleted.

Changes:

  • Implemented validation to ensure document ID matches a Firebase Auth UID.
  • Assigned admin role to the first document in the collection.
  • Managed roles in custom claims based on document changes.
  • Removed roles from custom claims when a user document is deleted.

Screen recording

WhatsApp.Video.2024-07-18.at.16.11.31.mp4

@DennisAlund DennisAlund added domain:auth Something related to auth platform:backend Backend / cloud functions labels Jul 18, 2024
@DennisAlund DennisAlund added this to the User management milestone Jul 18, 2024
@DennisAlund DennisAlund self-assigned this Jul 18, 2024
@DennisAlund DennisAlund marked this pull request as ready for review July 18, 2024 14:19
Copy link

github-actions bot commented Jul 18, 2024

Visit the preview URL for this PR (updated for commit ff9ec97):

https://tanam-testing--pr394-391-implement-role-m-r5638rhj.web.app

(expires Thu, 25 Jul 2024 14:27:18 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 5bbe8a1a68d9684d656bffba10008fe532204561

@muzanella11 muzanella11 merged commit ba9bf28 into milestone/4-user-management Jul 24, 2024
3 checks passed
@muzanella11 muzanella11 deleted the 391-implement-role-management-and-validation-for-user-documents branch July 24, 2024 01:23
@muzanella11 muzanella11 linked an issue Jul 24, 2024 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:auth Something related to auth platform:backend Backend / cloud functions
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Implement Role Management and Validation for User Documents
2 participants