@candlerip/shared3 0.0.88 → 0.0.89

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.88",
3
+ "version": "0.0.89",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -0,0 +1,4 @@
1
+ import { Candle, Person } from '../database/index.js';
2
+ export type CandleExtPerson = Candle & {
3
+ person: Person;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const hasCandlePermission: (userId: string | undefined, operation: "delete" | "edit" | "relight", options: {
2
+ candleUserId?: string;
3
+ personUserId?: string;
4
+ }) => boolean;
@@ -0,0 +1,13 @@
1
+ export const hasCandlePermission = (userId, operation, options) => {
2
+ const { candleUserId, personUserId } = options;
3
+ if (!userId) {
4
+ return false;
5
+ }
6
+ if (userId === candleUserId) {
7
+ return true;
8
+ }
9
+ if (userId === personUserId && operation === 'delete') {
10
+ return true;
11
+ }
12
+ return false;
13
+ };
@@ -0,0 +1 @@
1
+ export * from './has-candle-permission.js';
@@ -0,0 +1 @@
1
+ export * from './has-candle-permission.js';
@@ -1 +1,3 @@
1
+ export * from './candle-ext-person.types.js';
1
2
  export * from './candles-count/index.js';
3
+ export * from './candle-permission/index.js';
@@ -1 +1,3 @@
1
+ export * from './candle-ext-person.types.js';
1
2
  export * from './candles-count/index.js';
3
+ export * from './candle-permission/index.js';