UI: Add permission checks (albums) #98

This commit is contained in:
Timo Volkmann 2021-10-14 15:24:37 +02:00
parent d817a42ea2
commit 9811c86ee8
7 changed files with 13 additions and 12 deletions

View file

@ -33,6 +33,7 @@
<v-icon>share</v-icon>
</v-btn>
<v-btn
v-if="hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate)"
fab dark small
:title="$gettext('Edit')"
color="edit"
@ -54,7 +55,7 @@
<v-icon>get_app</v-icon>
</v-btn>
<v-btn
v-if="features.albums"
v-if="features.albums && hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate, aclActions.ActionCreate)"
fab dark small
:title="$gettext('Add to album')"
color="album"
@ -65,7 +66,7 @@
<v-icon>bookmark</v-icon>
</v-btn>
<v-btn
v-if="deletable.includes(context)"
v-if="deletable.includes(context) && hasPermission(aclResources.ResourceAlbums, aclActions.ActionDelete)"
fab dark small
color="remove"
:title="$gettext('Delete')"

View file

@ -13,7 +13,7 @@
<v-icon>refresh</v-icon>
</v-btn>
<v-btn icon class="action-edit" :title="$gettext('Edit')" @click.stop="dialog.edit = true">
<v-btn v-if="hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate)" icon class="action-edit" :title="$gettext('Edit')" @click.stop="dialog.edit = true">
<v-icon>edit</v-icon>
</v-btn>

View file

@ -36,7 +36,7 @@
</v-btn>
<v-btn
v-if="$config.feature('albums')"
v-if="$config.feature('albums') && hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate, aclActions.ActionCreate)"
fab dark small
:title="$gettext('Add to album')"
color="album"

View file

@ -36,7 +36,7 @@
<v-icon>cloud_download</v-icon>
</v-btn -->
<v-btn
v-if="$config.feature('albums')"
v-if="$config.feature('albums') && hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate, aclActions.ActionCreate)"
fab dark small
:title="$gettext('Add to album')"
color="album"

View file

@ -78,7 +78,7 @@
<v-icon>get_app</v-icon>
</v-btn>
<v-btn
v-if="context !== 'archive' && features.albums" fab dark
v-if="context !== 'archive' && features.albums && hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate, aclActions.ActionCreate)" fab dark
small
:title="$gettext('Add to album')"
color="album"
@ -111,7 +111,7 @@
<v-icon>unarchive</v-icon>
</v-btn>
<v-btn
v-if="isAlbum && features.albums" fab dark
v-if="isAlbum && features.albums && hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate)" fab dark
small
:title="$gettext('Remove from album')"
color="remove"

View file

@ -36,7 +36,7 @@
</v-btn>
<v-btn
v-if="features.albums"
v-if="features.albums && hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate, aclActions.ActionCreate)"
fab dark small
:title="$gettext('Add to album')"
color="album"

View file

@ -39,7 +39,7 @@
<v-icon>cloud_upload</v-icon>
</v-btn>
<v-btn v-if="staticFilter.type === 'album'" icon class="action-add" :title="$gettext('Add Album')"
<v-btn v-if="staticFilter.type === 'album' && hasPermission(aclResources.ResourceAlbums, aclActions.ActionCreate)" icon class="action-add" :title="$gettext('Add Album')"
@click.prevent="create">
<v-icon>add</v-icon>
</v-btn>
@ -126,9 +126,9 @@
icon flat absolute
class="input-favorite"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="toggleLike($event, index)"
@touchend.stop.prevent="hasPermission(aclResources.ResourceAlbums, aclActions.ActionLike) && toggleLike($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="toggleLike($event, index)">
@click.stop.prevent="hasPermission(aclResources.ResourceAlbums, aclActions.ActionLike) && toggleLike($event, index)">
<v-icon color="#FFD600" class="select-on">star</v-icon>
<v-icon color="white" class="select-off">star_border</v-icon>
</v-btn>
@ -138,7 +138,7 @@
<div>
<h3 class="body-2 mb-0">
<button v-if="album.Type !== 'month'" class="action-title-edit" :data-uid="album.UID"
@click.stop.prevent="edit(album)">
@click.stop.prevent="hasPermission(aclResources.ResourceAlbums, aclActions.ActionUpdate) && edit(album)">
{{ album.Title | truncate(80) }}
</button>
<button v-else class="action-title-edit" :data-uid="album.UID"