Skip to content

Commit

Permalink
Merge pull request #224 from BIDMCDigitalPsychiatry/serverwidetags
Browse files Browse the repository at this point in the history
#fixes new condition enabled for tags
  • Loading branch information
carlan1 authored Mar 7, 2023
2 parents c8b46b3 + a63ceac commit a47525d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/repository/couch/TypeRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ export class TypeRepository implements TypeInterface {
{ "#parent": type_id, type: type_id, key: attachment_key },
// Implicit self-ownership.
{ "#parent": type_id, type: "me", key: attachment_key },
{ "#parent": null, type: '*', key: attachment_key },
{ "#parent": type_id, type: '*', key: attachment_key },
{ "#parent": null, type: self_type, key: attachment_key },
{ "#parent": null, type: type_id, key: attachment_key },
{ "#parent": type_id, type: "null", key: attachment_key },
{ "#parent": null, type: "null", key: attachment_key },
]

// Following greatest-to-least priority, see if the Tag exists. We do this because:
Expand Down Expand Up @@ -186,6 +192,12 @@ export class TypeRepository implements TypeInterface {
{ "#parent": type_id, type: type_id, key: { $gt: null } },
// Implicit self-ownership.
{ "#parent": type_id, type: "me", key: { $gt: null } },
{ "#parent": null, type: '*', key: { $gt: null }},
{ "#parent": type_id, type: '*', key: { $gt: null }},
{ "#parent": null, type:self_type, key: { $gt: null }},
{ "#parent": null, type:type_id, key: { $gt: null }},
{ "#parent": type_id, type:"null", key: { $gt: null }},
{ "#parent": null, type:"null", key: { $gt: null }},
]

// Following greatest-to-least priority, see if the Tag exists. We do this because:
Expand Down
12 changes: 12 additions & 0 deletions src/repository/mongo/TypeRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ export class TypeRepository implements TypeInterface {
{ _deleted: false, _parent: type_id, type: type_id, key: attachment_key },
// Implicit self-ownership.
{ _deleted: false, _parent: type_id, type: "me", key: attachment_key },
{ _deleted: false, _parent: null, type: '*', key: attachment_key },
{ _deleted: false, _parent: type_id, type: '*', key: attachment_key },
{ _deleted: false, _parent:null , type: self_type, key: attachment_key },
{ _deleted: false, _parent:null , type: type_id, key: attachment_key },
{ _deleted: false, _parent:type_id , type: "null", key: attachment_key },
{ _deleted: false, _parent:null , type: "null", key: attachment_key },
]

// Following greatest-to-least priority, see if the Tag exists. We do this because:
Expand Down Expand Up @@ -160,6 +166,12 @@ export class TypeRepository implements TypeInterface {
{ _deleted: false, _parent: type_id, type: type_id, key: { $ne: null } },
// Implicit self-ownership.
{ _deleted: false, _parent: type_id, type: "me", key: { $ne: null } },
{ _deleted: false, _parent: null, type: '*', key: { $ne: null }},
{ _deleted: false, _parent: type_id, type: '*', key: { $ne: null }},
{ _deleted: false, _parent: null, type: self_type, key: { $ne: null }},
{ _deleted: false, _parent: null, type: type_id, key: { $ne: null }},
{ _deleted: false, _parent: type_id, type: "null", key: { $ne: null }},
{ _deleted: false, _parent: null, type: "null", key: { $ne: null }},
]

// Following greatest-to-least priority, see if the Tag exists. We do this because:
Expand Down

0 comments on commit a47525d

Please sign in to comment.