@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 +1 -1
- package/src/candle/candle-ext-person.types.d.ts +4 -0
- package/src/candle/candle-ext-person.types.js +1 -0
- package/src/candle/candle-permission/has-candle-permission.d.ts +4 -0
- package/src/candle/candle-permission/has-candle-permission.js +13 -0
- package/src/candle/candle-permission/index.d.ts +1 -0
- package/src/candle/candle-permission/index.js +1 -0
- package/src/candle/index.d.ts +2 -0
- package/src/candle/index.js +2 -0
package/package.json
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -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';
|
package/src/candle/index.d.ts
CHANGED
package/src/candle/index.js
CHANGED