mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
✨ Add improved abstraction for team permissions
Relevant changes: - replace user-viewer? with can-edit removing many double negations on the code - always use team permissions making the permissions access uniform around all the code - expose team permissions to ui tree through ctx/team-permissions context
This commit is contained in:
parent
b3fcbd91e4
commit
d6da8afdce
29 changed files with 412 additions and 391 deletions
|
@ -19,9 +19,11 @@
|
|||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc libraries-page
|
||||
[{:keys [team you-viewer?] :as props}]
|
||||
{::mf/props :obj}
|
||||
[{:keys [team] :as props}]
|
||||
(let [files-map (mf/deref refs/dashboard-shared-files)
|
||||
projects (mf/deref refs/dashboard-projects)
|
||||
can-edit (-> team :permissions :can-edit)
|
||||
|
||||
default-project (->> projects vals (d/seek :is-default))
|
||||
|
||||
|
@ -56,6 +58,6 @@
|
|||
:project default-project
|
||||
:origin :libraries
|
||||
:limit limit
|
||||
:you-viewer? you-viewer?
|
||||
:can-edit can-edit
|
||||
:library-view? components-v2}]]]))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue