From f91984d21b921b53d73e719d62a3238061a33f4b Mon Sep 17 00:00:00 2001 From: Nick Taylor Date: Fri, 1 Oct 2021 15:30:11 -0400 Subject: [PATCH] Added the creator method to the user model (#14883) --- app/models/user.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index f234f5865..906dfba78 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -347,6 +347,10 @@ class User < ApplicationRecord has_role?(:super_admin) end + def creator? + has_role?(:creator) + end + def any_admin? @any_admin ||= roles.where(name: ANY_ADMIN_ROLES).any? end