From f4a353d009b5d722e660449fd2a324aa5a2ab08e Mon Sep 17 00:00:00 2001
From: Marcela Ribeiro de Oliveira <mro15@inf.ufpr.br>
Date: Mon, 3 Jul 2017 13:06:45 -0300
Subject: [PATCH] change can moderate method to can edit

---
 app/models/user.rb | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/app/models/user.rb b/app/models/user.rb
index 78ce1d7f..4ec848aa 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -99,22 +99,29 @@ class User < ApplicationRecord
     false
   end
 
-  def is_curator?
+  def is_moderator?
     roles.each do |role|
-      return true if role.name == 'curator'
+      return true if role.name == 'moderator'
     end
     false
   end
 
-  def is_moderator?
+  def is_supervisor?
     roles.each do |role|
-      return true if role.name == 'moderator'
+      return true if role.name == 'supervisor'
+    end
+    false
+  end
+
+  def is_editor?
+    roles.each do |role|
+      return true if role.name == 'editor'
     end
     false
   end
 
-  def can_moderate?
-    self.is_admin? || self.is_moderator?
+  def can_edit?
+    self.is_admin? || self.is_editor?
   end
 
   def associated_collections
-- 
GitLab