projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
closes #9587
[arvados.git]
/
apps
/
workbench
/
app
/
models
/
arvados_base.rb
diff --git
a/apps/workbench/app/models/arvados_base.rb
b/apps/workbench/app/models/arvados_base.rb
index b02db7a6b63b5fad8c75ea5f107baa74a58d7151..f06193c3ecfaeb307ae0a2a86009270b9a4b266c 100644
(file)
--- a/
apps/workbench/app/models/arvados_base.rb
+++ b/
apps/workbench/app/models/arvados_base.rb
@@
-144,10
+144,18
@@
class ArvadosBase < ActiveRecord::Base
ArvadosResourceList.new(self).select(*args)
end
ArvadosResourceList.new(self).select(*args)
end
+ def self.with_count(*args)
+ ArvadosResourceList.new(self).with_count(*args)
+ end
+
def self.distinct(*args)
ArvadosResourceList.new(self).distinct(*args)
end
def self.distinct(*args)
ArvadosResourceList.new(self).distinct(*args)
end
+ def self.include_trash(*args)
+ ArvadosResourceList.new(self).include_trash(*args)
+ end
+
def self.eager(*args)
ArvadosResourceList.new(self).eager(*args)
end
def self.eager(*args)
ArvadosResourceList.new(self).eager(*args)
end
@@
-334,7
+342,7
@@
class ArvadosBase < ActiveRecord::Base
end
def self.creatable?
end
def self.creatable?
- current_user.andand.is_active
+ current_user.andand.is_active
&& api_exists?(:create)
end
def self.goes_in_projects?
end
def self.goes_in_projects?
@@
-361,6
+369,10
@@
class ArvadosBase < ActiveRecord::Base
editable?
end
editable?
end
+ def self.api_exists?(method)
+ arvados_api_client.discovery[:resources][self.to_s.underscore.pluralize.to_sym].andand[:methods].andand[method]
+ end
+
# Array of strings that are the names of attributes that can be edited
# with X-Editable.
def editable_attributes
# Array of strings that are the names of attributes that can be edited
# with X-Editable.
def editable_attributes