summaryrefslogtreecommitdiffstats
path: root/app/models/issue_import.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-05-09 07:40:06 +0000
committerGo MAEDA <maeda@farend.jp>2019-05-09 07:40:06 +0000
commitb540046ed7084ba50f5ca280f3ffae0751af8142 (patch)
tree4bc946090d4940a219e84f70ca72c5655de5be42 /app/models/issue_import.rb
parentbcc60805c97104f44a37b92321d7aa1e5c51b622 (diff)
downloadredmine-b540046ed7084ba50f5ca280f3ffae0751af8142.tar.gz
redmine-b540046ed7084ba50f5ca280f3ffae0751af8142.zip
Generalize issues imports (#28234).
Extend import controller to support arbitrary imports based on Import subclasses. This way, we may add other kinds of imports, by providing some views and a custom import class. This may also be done from within plugins. Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@18145 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_import.rb')
-rw-r--r--app/models/issue_import.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/issue_import.rb b/app/models/issue_import.rb
index 6c59b26db..5a3542291 100644
--- a/app/models/issue_import.rb
+++ b/app/models/issue_import.rb
@@ -18,6 +18,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssueImport < Import
+ def self.menu_item
+ :issues
+ end
+
+ def self.authorized?(user)
+ user.allowed_to?(:import_issues, nil, :global => true)
+ end
# Returns the objects that were imported
def saved_objects