Skip to content

Commit

Permalink
Remove unused period editing functions
Browse files Browse the repository at this point in the history
Periods can no longer be created, updated, or deleted. Remove the
functions and Firestore rules for it.
  • Loading branch information
simenheg committed Sep 1, 2023
1 parent 3b84a1f commit 41df65c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 65 deletions.
7 changes: 3 additions & 4 deletions firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ service cloud.firestore {
return userIsTeamMember;
}

// Is a member from the parent of the Objective/KeyResult/Period/KPI
/**
* Return true if the current user is a member of `document.parent`.
*/
function isMemberOfParent(document, type) {
let userRef = /databases/$(database)/documents/users/$(request.auth.token.email);
let doc = getAfter(/databases/$(database)/documents/$(type)/$(document));
Expand Down Expand Up @@ -149,9 +151,6 @@ service cloud.firestore {

match /periods/{document} {
allow read: if isSignedIn();
allow create: if isSuperAdmin() || isMemberOfParent(document, 'periods') || isAdminOfParent(document, 'periods');
allow update: if isSuperAdmin() || isMemberOfParent(document, 'periods') || isAdminOfParent(document, 'periods');
allow delete: if isSuperAdmin();
}

match /kpis/{document} {
Expand Down
40 changes: 0 additions & 40 deletions src/db/Period/Period.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/db/Period/index.js

This file was deleted.

18 changes: 0 additions & 18 deletions src/db/Period/props.js

This file was deleted.

0 comments on commit 41df65c

Please sign in to comment.