As target projects only those projects with DMSF module enabled
This commit is contained in:
parent
d4d5e78fd8
commit
29e89f9692
@ -237,7 +237,10 @@ class DmsfFile < ActiveRecord::Base
|
||||
if User.current.admin?
|
||||
projects = Project.visible.has_module('dmsf').all
|
||||
elsif User.current.logged?
|
||||
User.current.memberships.each {|m| projects << m.project if m.roles.detect {|r| r.allowed_to?(:file_manipulation)} && m.project.module_enabled?('dmsf')}
|
||||
User.current.memberships.each do |m|
|
||||
projects << m.project if m.project.module_enabled?('dmsf') &&
|
||||
m.roles.detect { |r| r.allowed_to?(:file_manipulation) }
|
||||
end
|
||||
end
|
||||
projects
|
||||
end
|
||||
|
||||
@ -217,9 +217,12 @@ class DmsfFolder < ActiveRecord::Base
|
||||
def self.allowed_target_projects_on_copy
|
||||
projects = []
|
||||
if User.current.admin?
|
||||
projects = Project.visible.all
|
||||
projects = Project.visible.has_module('dmsf').all
|
||||
elsif User.current.logged?
|
||||
User.current.memberships.each {|m| projects << m.project if m.roles.detect {|r| r.allowed_to?(:folder_manipulation) && r.allowed_to?(:file_manipulation)}}
|
||||
User.current.memberships.each do |m|
|
||||
projects << m.project if m.project.module_enabled?('dmsf') &&
|
||||
m.roles.detect { |r| r.allowed_to?(:folder_manipulation) && r.allowed_to?(:file_manipulation) }
|
||||
end
|
||||
end
|
||||
projects
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user