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