mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 00:19:07 -05:00
commit
d1dd13fde9
3 changed files with 28 additions and 13 deletions
|
@ -7776,6 +7776,9 @@ function Ml(t, e) {
|
||||||
get selection() {
|
get selection() {
|
||||||
return o("content:read"), t.selection;
|
return o("content:read"), t.selection;
|
||||||
},
|
},
|
||||||
|
set selection(i) {
|
||||||
|
o("content:read"), t.selection = i;
|
||||||
|
},
|
||||||
get viewport() {
|
get viewport() {
|
||||||
return t.viewport;
|
return t.viewport;
|
||||||
},
|
},
|
||||||
|
|
|
@ -205,35 +205,38 @@
|
||||||
|
|
||||||
[:div {:class (stl/css :modal-content)}
|
[:div {:class (stl/css :modal-content)}
|
||||||
[:div {:class (stl/css :permissions-list)}
|
[:div {:class (stl/css :permissions-list)}
|
||||||
(when (contains? permissions "content:read")
|
(cond
|
||||||
|
(contains? permissions "content:write")
|
||||||
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
|
i/oauth-1
|
||||||
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
|
(tr "workspace.plugins.permissions.content-write")]]
|
||||||
|
|
||||||
|
(contains? permissions "content:read")
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-1
|
i/oauth-1
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.content-read")]])
|
(tr "workspace.plugins.permissions.content-read")]])
|
||||||
|
|
||||||
(when (contains? permissions "content:write")
|
(cond
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
(contains? permissions "user:read")
|
||||||
i/oauth-1
|
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
|
||||||
(tr "workspace.plugins.permissions.content-write")]])
|
|
||||||
|
|
||||||
(when (contains? permissions "user:read")
|
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-2
|
i/oauth-2
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.user-read")]])
|
(tr "workspace.plugins.permissions.user-read")]])
|
||||||
|
|
||||||
(when (contains? permissions "library:read")
|
(cond
|
||||||
|
(contains? permissions "library:write")
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-3
|
i/oauth-3
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.library-read")]])
|
(tr "workspace.plugins.permissions.library-write")]]
|
||||||
|
|
||||||
(when (contains? permissions "library:write")
|
(contains? permissions "library:read")
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-3
|
i/oauth-3
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.library-write")]])]
|
(tr "workspace.plugins.permissions.library-read")]])]
|
||||||
|
|
||||||
[:div {:class (stl/css :permissions-disclaimer)}
|
[:div {:class (stl/css :permissions-disclaimer)}
|
||||||
(tr "workspace.plugins.permissions.disclaimer")]]
|
(tr "workspace.plugins.permissions.disclaimer")]]
|
||||||
|
|
|
@ -47,7 +47,16 @@
|
||||||
desc (obj/get manifest "description")
|
desc (obj/get manifest "description")
|
||||||
code (obj/get manifest "code")
|
code (obj/get manifest "code")
|
||||||
icon (obj/get manifest "icon")
|
icon (obj/get manifest "icon")
|
||||||
permissions (obj/get manifest "permissions")
|
|
||||||
|
permissions (into #{} (obj/get manifest "permissions" []))
|
||||||
|
permissions
|
||||||
|
(cond-> permissions
|
||||||
|
(contains? permissions "content:write")
|
||||||
|
(conj "content:read")
|
||||||
|
|
||||||
|
(contains? permissions "library:write")
|
||||||
|
(conj "content:write"))
|
||||||
|
|
||||||
origin (obj/get (js/URL. plugin-url) "origin")
|
origin (obj/get (js/URL. plugin-url) "origin")
|
||||||
plugin-id (str (uuid/next))]
|
plugin-id (str (uuid/next))]
|
||||||
{:plugin-id plugin-id
|
{:plugin-id plugin-id
|
||||||
|
|
Loading…
Add table
Reference in a new issue