mnfst 0.5.143 → 0.5.144
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.
|
@@ -5525,29 +5525,43 @@ function initializeTeamsConvenience() {
|
|
|
5525
5525
|
return userRoles.includes('owner');
|
|
5526
5526
|
};
|
|
5527
5527
|
|
|
5528
|
-
// Synchronous version for Alpine.js bindings (
|
|
5528
|
+
// Synchronous version for Alpine.js bindings (x-show / :disabled).
|
|
5529
|
+
// Resolves from the cached role definitions (allTeamRoles) so it matches
|
|
5530
|
+
// the async hasTeamPermission() — including custom permission keys, not
|
|
5531
|
+
// just the six built-ins the permission cache pre-computes.
|
|
5529
5532
|
store.hasTeamPermissionSync = function (permission) {
|
|
5530
5533
|
if (!this.currentTeam || !this.currentTeamMemberships || !this.user) {
|
|
5531
5534
|
return false;
|
|
5532
5535
|
}
|
|
5533
5536
|
|
|
5534
|
-
|
|
5535
|
-
if (
|
|
5536
|
-
return
|
|
5537
|
+
const userRoles = this.getCurrentTeamRoles();
|
|
5538
|
+
if (!Array.isArray(userRoles)) {
|
|
5539
|
+
return false;
|
|
5537
5540
|
}
|
|
5538
5541
|
|
|
5539
|
-
//
|
|
5540
|
-
//
|
|
5541
|
-
const
|
|
5542
|
-
const customRoles = userRoles.filter(role => role !== 'owner');
|
|
5542
|
+
// The merged config + user-generated role map for the current team
|
|
5543
|
+
// (same map the async path resolves against), available synchronously.
|
|
5544
|
+
const allRoles = (this.allTeamRoles && this.allTeamRoles(this.currentTeam)) || {};
|
|
5543
5545
|
|
|
5544
|
-
//
|
|
5545
|
-
|
|
5546
|
+
// No custom roles defined → owner has every permission.
|
|
5547
|
+
if (!allRoles || Object.keys(allRoles).length === 0) {
|
|
5548
|
+
return userRoles.includes('owner');
|
|
5549
|
+
}
|
|
5550
|
+
|
|
5551
|
+
// User holds no custom role (only "owner" / empty) → all permissions.
|
|
5552
|
+
const customRoles = userRoles.filter(role => role !== 'owner');
|
|
5546
5553
|
if (customRoles.length === 0) {
|
|
5547
5554
|
return true;
|
|
5548
5555
|
}
|
|
5549
5556
|
|
|
5550
|
-
//
|
|
5557
|
+
// Granted if any of the user's custom roles includes this permission
|
|
5558
|
+
// (built-in or custom key).
|
|
5559
|
+
for (const roleName of customRoles) {
|
|
5560
|
+
const rolePermissions = allRoles[roleName];
|
|
5561
|
+
if (Array.isArray(rolePermissions) && rolePermissions.includes(permission)) {
|
|
5562
|
+
return true;
|
|
5563
|
+
}
|
|
5564
|
+
}
|
|
5551
5565
|
return false;
|
|
5552
5566
|
};
|
|
5553
5567
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"manifest.appwrite.auth.js": "sha384
|
|
2
|
+
"manifest.appwrite.auth.js": "sha384-/IbcczrhhYWlsQFvFmHkulV1JPIBBFvMH513PwsnJo+D0F+YKhGJ1ig/UmJbGSe/",
|
|
3
3
|
"manifest.appwrite.data.js": "sha384-00ulLT+GAIuPHA/rRT9p98vYlsyDzkyKXtg86BDQ6FGQa5vVVN+W6kuforniBAsz",
|
|
4
4
|
"manifest.appwrite.presence.js": "sha384-uxRpx9/Jj0kGtklH5QmUlAzD3zdSvFRfK6bcJQqxl+Bsf5tOo4zgwqJTQgtZoHQP",
|
|
5
5
|
"manifest.charts.js": "sha384-RuV7gWXt3s+JegxWgDieR/P5U99sbOYWiYHdJGe2uCJjDFU1cPp0mJ1QT55ec9uz",
|