Skip to content

Commit

Permalink
lock blog tag (publiclab#8398)
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren authored and billymoroney1 committed Dec 28, 2021
1 parent 43cedf8 commit 5c2d38e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,8 @@ def can_tag(tagname, user, errors = false)
errors ? I18n.t('node.only_RSVP_for_yourself') : false
elsif tagname == 'locked' && user.role != 'admin'
errors ? I18n.t('node.only_admins_can_lock') : false
elsif tagname == 'blog' && user.role != 'admin' && user.role != 'moderator'
errors ? 'Only moderators or admins can use this tag.' : false
elsif tagname.split(':')[0] == 'redirect' && Node.where(slug: one_split).size <= 0
errors ? I18n.t('node.page_does_not_exist') : false
elsif socials[one_split&.to_sym].present?
Expand Down

0 comments on commit 5c2d38e

Please sign in to comment.