diff --git a/ui/src/playlist/PlaylistList.js b/ui/src/playlist/PlaylistList.js index 9929af07b..4e06e61e9 100644 --- a/ui/src/playlist/PlaylistList.js +++ b/ui/src/playlist/PlaylistList.js @@ -20,7 +20,7 @@ const PlaylistFilter = (props) => ( ) -const TogglePublicInput = ({ resource, record, source }) => { +const TogglePublicInput = ({ permissions, resource, record, source }) => { const notify = useNotify() const [togglePublic] = useUpdate( resource, @@ -43,10 +43,20 @@ const TogglePublicInput = ({ resource, record, source }) => { e.stopPropagation() } - return + const canChange = + permissions === 'admin' || + localStorage.getItem('username') === record['owner'] + + return ( + + ) } -const PlaylistList = (props) => ( +const PlaylistList = ({ permissions, ...props }) => ( }> isWritable(r && r.owner)}> @@ -54,7 +64,7 @@ const PlaylistList = (props) => ( - +