mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-05 09:48:37 +01:00
17 lines
449 B
JavaScript
17 lines
449 B
JavaScript
export const isWritable = (ownerId) => {
|
|
return (
|
|
localStorage.getItem('userId') === ownerId ||
|
|
localStorage.getItem('role') === 'admin'
|
|
)
|
|
}
|
|
|
|
export const isReadOnly = (ownerId) => {
|
|
return !isWritable(ownerId)
|
|
}
|
|
|
|
export const isSmartPlaylist = (pls) => !!pls.rules
|
|
|
|
export const isGlobalPlaylist = (pls) => isSmartPlaylist(pls) && pls.global
|
|
|
|
export const canChangeTracks = (pls) =>
|
|
isWritable(pls.ownerId) && !isSmartPlaylist(pls)
|