etna 0.1.27 → 0.1.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/etna.completion +137 -55
- data/lib/etna.rb +1 -0
- data/lib/etna/application.rb +4 -0
- data/lib/etna/client.rb +30 -2
- data/lib/etna/clients/magma/formatting.rb +2 -1
- data/lib/etna/clients/magma/formatting/models_odm_xml.rb +293 -0
- data/lib/etna/clients/magma/models.rb +13 -1
- data/lib/etna/clients/magma/workflows/create_project_workflow.rb +1 -1
- data/lib/etna/clients/magma/workflows/crud_workflow.rb +19 -2
- data/lib/etna/clients/magma/workflows/materialize_magma_record_files_workflow.rb +46 -30
- data/lib/etna/clients/magma/workflows/model_synchronization_workflow.rb +1 -1
- data/lib/etna/clients/magma/workflows/update_attributes_from_csv_workflow.rb +19 -6
- data/lib/etna/clients/magma/workflows/walk_model_tree_workflow.rb +33 -6
- data/lib/etna/clients/metis/client.rb +6 -1
- data/lib/etna/clients/metis/models.rb +15 -0
- data/lib/etna/clients/metis/workflows/metis_download_workflow.rb +15 -11
- data/lib/etna/clients/metis/workflows/metis_upload_workflow.rb +83 -13
- data/lib/etna/clients/metis/workflows/sync_metis_data_workflow.rb +43 -79
- data/lib/etna/command.rb +10 -0
- data/lib/etna/cwl.rb +701 -0
- data/lib/etna/directed_graph.rb +50 -0
- data/lib/etna/filesystem.rb +145 -15
- data/lib/etna/generate_autocompletion_script.rb +11 -6
- data/lib/etna/hmac.rb +2 -2
- data/lib/etna/route.rb +44 -4
- data/lib/etna/spec/auth.rb +6 -6
- data/lib/etna/user.rb +15 -11
- metadata +33 -3
data/lib/etna/user.rb
CHANGED
@@ -7,14 +7,14 @@ module Etna
|
|
7
7
|
}
|
8
8
|
|
9
9
|
def initialize params, token=nil
|
10
|
-
@
|
10
|
+
@name, @email, @encoded_permissions, encoded_flags = params.values_at(:name, :email, :perm, :flags)
|
11
11
|
|
12
12
|
@flags = encoded_flags&.split(/;/) || []
|
13
13
|
@token = token unless !token
|
14
14
|
raise ArgumentError, "No email given!" unless @email
|
15
15
|
end
|
16
16
|
|
17
|
-
attr_reader :
|
17
|
+
attr_reader :name, :email, :token
|
18
18
|
|
19
19
|
def permissions
|
20
20
|
@permissions ||= @encoded_permissions.split(/\;/).map do |roles|
|
@@ -36,10 +36,6 @@ module Etna
|
|
36
36
|
@flags.include?(flag)
|
37
37
|
end
|
38
38
|
|
39
|
-
def name
|
40
|
-
"#{first} #{last}"
|
41
|
-
end
|
42
|
-
|
43
39
|
def projects
|
44
40
|
permissions.keys
|
45
41
|
end
|
@@ -50,7 +46,7 @@ module Etna
|
|
50
46
|
viewer: /[Vv]/,
|
51
47
|
restricted: /[AEV]/,
|
52
48
|
}
|
53
|
-
def
|
49
|
+
def has_any_role?(project, *roles)
|
54
50
|
perm = permissions[project.to_s]
|
55
51
|
|
56
52
|
return false unless perm
|
@@ -59,15 +55,23 @@ module Etna
|
|
59
55
|
end
|
60
56
|
|
61
57
|
def is_superuser? project=nil
|
62
|
-
|
58
|
+
has_any_role?(:administration, :admin)
|
59
|
+
end
|
60
|
+
|
61
|
+
def is_supereditor? project=nil
|
62
|
+
has_any_role?(:administration, :admin, :editor)
|
63
|
+
end
|
64
|
+
|
65
|
+
def is_superviewer? project=nil
|
66
|
+
has_any_role?(:administration, :admin, :editor, :viewer)
|
63
67
|
end
|
64
68
|
|
65
69
|
def can_edit? project
|
66
|
-
|
70
|
+
is_supereditor? || has_any_role?(project, :admin, :editor)
|
67
71
|
end
|
68
72
|
|
69
73
|
def can_view? project
|
70
|
-
|
74
|
+
is_superviewer? || has_any_role?(project, :admin, :editor, :viewer)
|
71
75
|
end
|
72
76
|
|
73
77
|
# superusers - administrators of the Administration group - cannot
|
@@ -79,7 +83,7 @@ module Etna
|
|
79
83
|
end
|
80
84
|
|
81
85
|
def is_admin? project
|
82
|
-
is_superuser? ||
|
86
|
+
is_superuser? || has_any_role?(project, :admin)
|
83
87
|
end
|
84
88
|
|
85
89
|
def active? project=nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etna
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saurabh Asthana
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: concurrent-ruby
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: concurrent-ruby-ext
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
description: See summary
|
84
112
|
email: Saurabh.Asthana@ucsf.edu
|
85
113
|
executables:
|
@@ -107,6 +135,7 @@ files:
|
|
107
135
|
- lib/etna/clients/magma/client.rb
|
108
136
|
- lib/etna/clients/magma/formatting.rb
|
109
137
|
- lib/etna/clients/magma/formatting/models_csv.rb
|
138
|
+
- lib/etna/clients/magma/formatting/models_odm_xml.rb
|
110
139
|
- lib/etna/clients/magma/models.rb
|
111
140
|
- lib/etna/clients/magma/workflows.rb
|
112
141
|
- lib/etna/clients/magma/workflows/add_project_models_workflow.rb
|
@@ -139,6 +168,7 @@ files:
|
|
139
168
|
- lib/etna/controller.rb
|
140
169
|
- lib/etna/cross_origin.rb
|
141
170
|
- lib/etna/csvs.rb
|
171
|
+
- lib/etna/cwl.rb
|
142
172
|
- lib/etna/describe_routes.rb
|
143
173
|
- lib/etna/directed_graph.rb
|
144
174
|
- lib/etna/environment_scoped.rb
|