diff --git a/app/abilities/photo.js b/app/abilities/photo.js index 92ee0cff6..14ecfea50 100644 --- a/app/abilities/photo.js +++ b/app/abilities/photo.js @@ -6,10 +6,7 @@ export default class Photo extends Ability { } get canShowPhotoComments() { - return ( - this.session.hasPermission('photo-comment.read') || - this.model.photoAlbum.get('publiclyVisible') - ); + return this.session.hasPermission('photo-comment.read'); } get canShowPhotoTags() { diff --git a/app/components/forms/photo-album-form.hbs b/app/components/forms/photo-album-form.hbs index fe13348ae..e97ffd534 100644 --- a/app/components/forms/photo-album-form.hbs +++ b/app/components/forms/photo-album-form.hbs @@ -15,12 +15,17 @@ @property='date' @label='Datum van activiteit' /> - + - + @property='visibility' + @options={{this.visibilityOptions}} + @inputLayout='vertical' + @label='Zichtbaar voor' + @inputIdentifier='photoCategory' + @class='sort-radio-group' + /> + {{#if @model.publiclyVisible}}
@@ -92,4 +97,4 @@
-
\ No newline at end of file + diff --git a/app/models/photo-album.js b/app/models/photo-album.js index f063eb8fb..4f09869f0 100644 --- a/app/models/photo-album.js +++ b/app/models/photo-album.js @@ -4,7 +4,7 @@ export default class PhotoAlbum extends Model { // Properties @attr title; @attr('date-only') date; - @attr({ defaultValue: false }) publiclyVisible; + @attr visibility; // Relations @hasMany photos; @@ -47,6 +47,14 @@ export default class PhotoAlbum extends Model { return this.photos.length; } + get visibilityOptions() { + return [ + { value: 'public', label: 'Iedereen' }, + { value: 'alumni', label: 'Leden & oudleden' }, + { value: 'author', label: 'Leden' }, + ]; + } + // Methods isOwner(user) { if (user.get('id') === this.author.get('id')) {