@kaspernj/api-maker 1.0.151 → 1.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/can-can.cjs +14 -12
package/package.json
CHANGED
package/src/can-can.cjs
CHANGED
|
@@ -46,18 +46,20 @@ module.exports = class ApiMakerCanCan {
|
|
|
46
46
|
const abilityDataSubject = digg(abilityData, "subject")
|
|
47
47
|
const abilityDataAbility = digg(abilityData, "ability")
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
if (abilityDataAbility == ability) {
|
|
50
|
+
// If actually same class
|
|
51
|
+
if (abilityDataSubject == subject) return true
|
|
52
|
+
|
|
53
|
+
// Sometimes in dev when using linking it will actually be two different but identical resource classes
|
|
54
|
+
if (
|
|
55
|
+
typeof subject == "function" &&
|
|
56
|
+
subject.modelClassData &&
|
|
57
|
+
typeof abilityDataSubject == "function" &&
|
|
58
|
+
abilityDataSubject.modelClassData &&
|
|
59
|
+
digg(subject.modelClassData(), "name") == digg(abilityDataSubject.modelClassData(), "name")
|
|
60
|
+
) {
|
|
61
|
+
return true
|
|
62
|
+
}
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
return false
|