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

Milestone 4: user management #397

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

Merged
merged 55 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
c484334
Adding tanam user class
DennisAlund Jul 17, 2024
0058835
Removing super admin role from rules
DennisAlund Jul 17, 2024
761ebb6
Adding trigger methods
DennisAlund Jul 17, 2024
9597e77
Exporting the user trigger functions
DennisAlund Jul 17, 2024
78a191d
Updating firestore rules
DennisAlund Jul 18, 2024
d38496d
Renaming functions
DennisAlund Jul 18, 2024
62087fb
Adding some logging
DennisAlund Jul 18, 2024
ff9ec97
Prevent user from changing roles by themselves
DennisAlund Jul 18, 2024
ba9bf28
Merge pull request #394 from oddbit/391-implement-role-management-and…
muzanella11 Jul 24, 2024
fb88307
setup local emulator but still error
muzanella11 Jul 24, 2024
9fd22bc
Updating tanam user models
DennisAlund Jul 26, 2024
13ae71e
Taking display name from Firebase auth user
DennisAlund Jul 26, 2024
186d27f
Lint fixing
DennisAlund Jul 26, 2024
cdf7173
Adding hook for getting user from firestore
DennisAlund Jul 26, 2024
63446d7
Updating page header display of name
DennisAlund Jul 26, 2024
e1f474d
Updating hook with optional uid parameter
DennisAlund Jul 27, 2024
e56d903
Merge pull request #408 from oddbit/issue/404-set-user-name
muzanella11 Jul 29, 2024
23f0742
Merge branch 'main' into milestone/4-user-management
muzanella11 Jul 29, 2024
f163565
Merge branch 'milestone/4-user-management' into issue/392-require-tan…
muzanella11 Jul 29, 2024
25480f7
remove unsed
muzanella11 Jul 29, 2024
b207b52
Adding sharp and axios to package.json
DennisAlund Jul 29, 2024
081ffb0
Fixing typo
DennisAlund Jul 29, 2024
767ba11
Renaming old function
DennisAlund Jul 29, 2024
3be3719
Implementing image downloading / uploading
DennisAlund Jul 29, 2024
3bfceaf
create error page
muzanella11 Jul 29, 2024
07144de
create error page
muzanella11 Jul 29, 2024
4a3d548
remove unused
muzanella11 Jul 29, 2024
76aad2e
redirect to error page when user doesnt have docid
muzanella11 Jul 29, 2024
ce299e2
move the redirect process in header
muzanella11 Jul 29, 2024
ef7984e
remove unused
muzanella11 Jul 29, 2024
7109423
update error page
muzanella11 Jul 29, 2024
a8ca876
fix lint
muzanella11 Jul 29, 2024
fd1adae
Updating storage rules
DennisAlund Jul 29, 2024
ae39523
Adding storage to firebase config
DennisAlund Jul 29, 2024
3bbc2e6
Updating user hook
DennisAlund Jul 29, 2024
2778d45
Updating user avatar
DennisAlund Jul 29, 2024
b0774d3
Updating use of user avatar in header
DennisAlund Jul 29, 2024
45f6e61
Moving user avatar component
DennisAlund Jul 29, 2024
f38663e
Merge pull request #409 from oddbit/issue/406-user-image
muzanella11 Jul 30, 2024
096b084
Updating placeholder avatar
DennisAlund Jul 30, 2024
23ee430
Updating next config to support firebase storage files
DennisAlund Jul 30, 2024
66ad6e8
Making profile picture readable to all users
DennisAlund Jul 30, 2024
f1c0984
remove yarn lock in gitignore
muzanella11 Jul 30, 2024
a592b53
add validation check custom claims
muzanella11 Jul 30, 2024
a8d3a32
fix inconsistency
muzanella11 Jul 30, 2024
827f797
specific error page for insufficient role
muzanella11 Jul 30, 2024
7064ec8
add functionality for get user role
muzanella11 Jul 30, 2024
7980dcb
fix lint
muzanella11 Jul 30, 2024
ae3bdac
remove unused
muzanella11 Jul 30, 2024
b1bcdec
Merge branch 'milestone/4-user-management' into issue/392-require-tan…
muzanella11 Jul 30, 2024
edb8e78
Merge pull request #410 from oddbit/issue/392-require-tanam-user-role…
DennisAlund Jul 30, 2024
2ec5bbe
Merge branch 'milestone/4-user-management' into issue/407-display-use…
DennisAlund Jul 30, 2024
7c264ad
Merge pull request #411 from oddbit/issue/407-display-user-image
muzanella11 Jul 30, 2024
43a2f08
Merge branch 'main' into milestone/4-user-management
DennisAlund Jul 30, 2024
435e3b0
Fixing package lock
DennisAlund Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ service cloud.firestore {
allow write: if isAtLeastAdmin();
}

match /tanam-users/{uid} {
allow read: if isSignedInAs(uid);
// Delete and create must be done manually
allow update: if isSignedInAs(uid) && request.resource.data.role == resource.data.role;
}

match /tanam-documents/{documentId} {
allow read: if hasAnyRole();
allow write: if isPublisher();
Expand All @@ -24,12 +30,8 @@ service cloud.firestore {
return isSignedIn() && request.auth.token.tanamRole != null;
}

function isSuperAdmin() {
return hasUserRole("superAdmin");
}

function isAtLeastAdmin() {
return isSuperAdmin() || hasUserRole("admin");
return hasUserRole("admin");
}

function isPublisher() {
Expand Down
1 change: 1 addition & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Compiled JavaScript files
lib
lib/**/*.js
lib/**/*.js.map

Expand Down
Loading
Loading