This commit is contained in:
Christoph Haas 2021-02-20 21:19:24 +01:00
parent 6542ffbc19
commit 443f898ffd

View file

@ -95,33 +95,33 @@ class Screenshot < ApplicationRecord
end
# Returns true if the current user has administrative permissions
def can_admin?
self.admin == 1
end
# def can_admin?
# self.admin == 1
# end
# Returns true if the current user can upload screenshots without moderation
def can_upload_without_moderation?
# Admins can upload without moderation
true if self.can_admin
# def can_upload_without_moderation?
# # Admins can upload without moderation
# true if self.can_admin
# Authenticated users with at least one approved screenshot
#true if self.screenshots.where(approved: true).count >= 1
# # Authenticated users with at least one approved screenshot
# #true if self.screenshots.where(approved: true).count >= 1
# Other visitors require moderation
false
end
# # Other visitors require moderation
# false
# end
# Returns true if the current user can delete screenshots
def can_delete?
# Admins can delete screenshots
true if self.can_admin
# def can_delete?
# # Admins can delete screenshots
# true if self.can_admin
# Authenticated users with at least one approved screenshot
#true if self.screenshots.where(approved: true).count >= 1
# # Authenticated users with at least one approved screenshot
# #true if self.screenshots.where(approved: true).count >= 1
# Other visitors require moderation
false
end
# # Other visitors require moderation
# false
# end
# Return the part of the version up to the first - or +
def upstream_version