Merge branch 'main' into eslint-standart

This commit is contained in:
Ulf Gebhardt 2024-11-01 14:58:04 +01:00 committed by GitHub
commit 268368b8b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 10 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "utopia-ui",
"version": "3.0.5",
"version": "3.0.10",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "utopia-ui",
"version": "3.0.5",
"version": "3.0.10",
"license": "MIT",
"dependencies": {
"@heroicons/react": "^2.0.17",

View File

@ -1,6 +1,6 @@
{
"name": "utopia-ui",
"version": "3.0.5",
"version": "3.0.10",
"description": "Reuseable React Components to build mapping apps for real life communities and networks",
"repository": "https://github.com/utopia-os/utopia-ui",
"homepage:": "https://utopia-os.org/",

View File

@ -76,11 +76,6 @@ function usePermissionsManager (initialPermissions: Permission[]): {
item?: Item,
layer?: LayerProps
) => {
console.log(layer?.name)
console.log(user?.role.name)
console.log(action)
console.log(permissions.filter(p => p.policy.name === user?.role.name || (p.policy.name === '$t:public_label' && !user)))
const evaluateCondition = (condition: any) => {
if (condition.user_created?._eq === '$CURRENT_USER') {
return item?.user_created?.id === user?.id
@ -111,11 +106,11 @@ function usePermissionsManager (initialPermissions: Permission[]): {
p.action === action &&
p.collection === collectionName &&
(
(p.policy.name === user?.role.name &&
(p.policy?.name === user?.role.name &&
(
!item || evaluatePermissions(p.permissions)
)) ||
(p.policy === '$t:public_label' &&
(p.policy?.name === "$t:public_label" &&
(
(layer?.public_edit_items || item?.layer?.public_edit_items) &&
(!item || evaluatePermissions(p.permissions))