@agendize/vue-acl
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -49,3 +49,3 @@ import { reactive as M } from "vue"; | ||
const s = []; | ||
return i.indexOf("r") > -1 && s.push("read" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("w") > -1 && s.push("create" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("u") > -1 && s.push("update" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("d") > -1 && s.push("delete" + e.charAt(0).toUpperCase() + e.slice(1)), (e === "appointment" || e === "staffAppointment") && (i.indexOf("a") > -1 && s.push("accept" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("c") > -1 && s.push("statusChange" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("f") > -1 && s.push("freemode" + e.charAt(0).toUpperCase() + e.slice(1))), s; | ||
return i.indexOf("r") > -1 && s.push("read" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("w") > -1 && s.push("create" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("u") > -1 && s.push("update" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("d") > -1 && s.push("delete" + e.charAt(0).toUpperCase() + e.slice(1)), (e === "appointment" || e === "staffAppointment") && (i.indexOf("a") > -1 && s.push("accept" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("c") > -1 && s.push("statusChange" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("f") > -1 && s.push("freemode" + e.charAt(0).toUpperCase() + e.slice(1)), i.indexOf("e") > -1 && s.push("event" + e.charAt(0).toUpperCase() + e.slice(1))), s; | ||
} | ||
@@ -55,3 +55,3 @@ } | ||
options: {} | ||
}), N = (t, e) => { | ||
}), L = (t, e) => { | ||
r.options = e; | ||
@@ -72,6 +72,6 @@ function i(d, o, f, p) { | ||
const u = (d, o, f) => { | ||
const p = o.arg, n = o.value, c = o.modifiers, a = !!c.any, l = !!c.not, h = !!c.readonly, g = !!(c.disable || c.disabled), y = !!(c.hide || c.hidden), L = F({ ability: p, args: n, any: a }); | ||
s(L, d, l, g, h, y); | ||
const p = o.arg, n = o.value, c = o.modifiers, a = !!c.any, l = !!c.not, h = !!c.readonly, g = !!(c.disable || c.disabled), y = !!(c.hide || c.hidden), N = U({ ability: p, args: n, any: a }); | ||
s(N, d, l, g, h, y); | ||
}, A = (d, o, f) => { | ||
const p = o.arg, n = o.modifiers, c = !!n.any, a = !!n.not, l = !!n.readonly, h = !!(n.disable || n.disabled), g = !!(n.hide || n.hidden), y = U({ roles: [p], any: c }); | ||
const p = o.arg, n = o.modifiers, c = !!n.any, a = !!n.not, l = !!n.readonly, h = !!(n.disable || n.disabled), g = !!(n.hide || n.hidden), y = F({ roles: [p], any: c }); | ||
s(y, d, a, h, l, g); | ||
@@ -109,3 +109,3 @@ }, m = (d, o) => { | ||
const a = n.meta.role; | ||
c = R(a); | ||
c = T(a); | ||
} else if (n.meta.roleNot) { | ||
@@ -149,3 +149,3 @@ const a = n.meta.roleNot; | ||
function t(e, i) { | ||
T ? e() : setTimeout(function() { | ||
R ? e() : setTimeout(function() { | ||
t(e); | ||
@@ -157,11 +157,11 @@ }, 30); | ||
install: (e, i = {}) => { | ||
N(e, t); | ||
L(e, t); | ||
} | ||
}); | ||
let T = !1; | ||
function D(t) { | ||
let R = !1; | ||
function x(t) { | ||
var i; | ||
return (((i = t.rightIds) == null ? void 0 : i.map((s) => E(s))) ?? []).filter((s) => !!s); | ||
return (((i = t.rightIds) == null ? void 0 : i.map((s) => D(s))) ?? []).filter((s) => !!s); | ||
} | ||
function E(t) { | ||
function D(t) { | ||
switch (t) { | ||
@@ -220,12 +220,12 @@ case "0": | ||
const t = {}; | ||
return t.can = C, t.can.not = v, t.can.any = b, t.role = R, t.role.not = I, t.role.any = O, t.init = async (e, i) => { | ||
return t.can = C, t.can.not = v, t.can.any = b, t.role = T, t.role.not = I, t.role.any = O, t.init = async (e, i) => { | ||
var s, u; | ||
return r.organisationEmail = e.organisation, r.userId = i, r.rolesType = D(e), (s = r.options.logger) == null || s.info("User roles", r.rolesType), r.abilities = [], r.companiesAbilities = /* @__PURE__ */ new Map(), e && e.rightIds && e.rightIds.length > 0 && (await r.options.api.getRights(e.organisation, e.rightIds)).forEach((m) => { | ||
return r.organisationEmail = e.organisation, r.userId = i, r.rolesType = x(e), (s = r.options.logger) == null || s.info("User roles", r.rolesType), r.abilities = [], r.companiesAbilities = /* @__PURE__ */ new Map(), e && e.rightIds && e.rightIds.length > 0 && (await r.options.api.getRights(e.organisation, e.rightIds)).forEach((m) => { | ||
var d, o; | ||
m.object && m.object.type ? m.object.type === "company" && ((d = r.companiesAbilities) == null || d.set(m.object.id, P.rightToAbilities(m))) : (o = r.abilities) == null || o.push(...P.rightToAbilities(m)); | ||
}), B(), (u = r.options.logger) == null || u.info("User abilities", r.abilities, r.companiesAbilities), T = !0, Promise.resolve(); | ||
}), B(), (u = r.options.logger) == null || u.info("User abilities", r.abilities, r.companiesAbilities), R = !0, Promise.resolve(); | ||
}, t.initStaffIds = (e) => { | ||
r.staffIds = e; | ||
}, M(t); | ||
}, C = (t, e, i) => S({ ability: t, args: e, args2: i, any: !1 }), v = (t, e, i) => !S({ ability: t, args: e, args2: i, any: !1 }), b = (t, e, i) => S({ ability: t, args: e, args2: i, any: !0 }), R = (t) => w({ roles: t, any: !1 }), I = (t) => w({ roles: t, any: !1 }), O = (t) => w({ roles: t, any: !0 }), S = ({ | ||
}, C = (t, e, i) => S({ ability: t, args: e, args2: i, any: !1 }), v = (t, e, i) => !S({ ability: t, args: e, args2: i, any: !1 }), b = (t, e, i) => S({ ability: t, args: e, args2: i, any: !0 }), T = (t) => w({ roles: t, any: !1 }), I = (t) => w({ roles: t, any: !1 }), O = (t) => w({ roles: t, any: !0 }), S = ({ | ||
ability: t, | ||
@@ -237,3 +237,3 @@ args: e, | ||
var u; | ||
return t ? F({ | ||
return t ? U({ | ||
ability: t, | ||
@@ -246,10 +246,10 @@ args: e, | ||
var i; | ||
return t ? U({ | ||
return t ? F({ | ||
roles: t, | ||
any: e | ||
}) : ((i = r.options.logger) == null || i.warn("vue-acl", "Invalid ACL arguments specified: ", t), !1); | ||
}, F = ({ ability: t, args: e, args2: i, any: s = !1 }) => { | ||
}, U = ({ ability: t, args: e, args2: i, any: s = !1 }) => { | ||
const u = t, A = e; | ||
return H(A ? { ability: u, args: A, args2: i, any: s } : { ability: u, any: s }); | ||
}, U = ({ roles: t, any: e }) => q({ roles: t, any: e }), H = ({ ability: t, args: e, args2: i, any: s = !1 }) => { | ||
}, F = ({ roles: t, any: e }) => E({ roles: t, any: e }), H = ({ ability: t, args: e, args2: i, any: s = !1 }) => { | ||
if (t) { | ||
@@ -264,4 +264,4 @@ if (s && Array.isArray(t)) { | ||
} | ||
return Array.isArray(e) && s ? x(Object.values(e)) : !1; | ||
}, q = ({ roles: t, any: e }) => t ? $(t, e) : !1, x = (t) => { | ||
return Array.isArray(e) && s ? q(Object.values(e)) : !1; | ||
}, E = ({ roles: t, any: e }) => t ? $(t, e) : !1, q = (t) => { | ||
let e = !1; | ||
@@ -268,0 +268,0 @@ for (const i of t) { |
{ | ||
"name": "@agendize/vue-acl", | ||
"private": false, | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "Vue agendize's ACL management", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17563