Skip to content

Commit b6a2568

Browse files
authored
Manage groups, Share studies (#1512)
Backend: - adds groups endpoint to list, create, get, modify, delete groups through /groups endpoint - a user in a group has read/write/delete access rights (e.g. member,manager,administrator) - add/list/modify/delete users in groups through /groups/{gid}/users endpoint - allow sharing of projects using access_rights defining for each group id the specific read/write/delete rights - migrates postgres DB accordingly (migrates old access_rights syntax for projects, deprecates user_to_projects table, adds groups thumbnails, ) Frontend: - New page in Preferences for managing/displaying Organizations and its members - Testers can create Organizations - Organization Managers can invite (actually add) osparc existing members by providing their - emails - Organization Managers can remove members - Organization Managers can promote members to Manager - Organization SuperManagers can edit organization details - Study owners can share the same instance of a study with Organizations and/or Organization Members (Collaborators) - Study owners can make other collaborators Owner - Study owners can remove collaborators Bonus Backend: - adds a decorator for checking role permissions - docs of how to use sc-pg migration capabilities Frontend: - Can edit study details also from inside study - Allow dropping files with no extension - Show hand cursor over dragable NodeUI ports - Show move cursor over NodeUI capationbar - Fix multiFilePicker bug - Switch button for changing theme
1 parent 16c30b9 commit b6a2568

File tree

117 files changed

+7623
-1530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+7623
-1530
lines changed

api/specs/common/schemas/project-v0.0.1-converted.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@ properties:
3434
description: >-
3535
object containing the GroupID as key and read/write/execution permissions
3636
as value
37+
additionalProperties: false
38+
x-patternProperties:
39+
^\d+$:
40+
type: object
41+
description: the group id
42+
additionalProperties: false
43+
required:
44+
- read
45+
- write
46+
- delete
47+
properties:
48+
read:
49+
type: boolean
50+
description: gives read access
51+
write:
52+
type: boolean
53+
description: gives write access
54+
delete:
55+
type: boolean
56+
description: gives deletion rights
3757
creationDate:
3858
type: string
3959
description: project creation date

api/specs/common/schemas/project-v0.0.1.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,34 @@
4646
},
4747
"accessRights": {
4848
"type": "object",
49-
"description": "object containing the GroupID as key and read/write/execution permissions as value"
49+
"description": "object containing the GroupID as key and read/write/execution permissions as value",
50+
"additionalProperties": false,
51+
"patternProperties": {
52+
"^\\d+$": {
53+
"type": "object",
54+
"description": "the group id",
55+
"additionalProperties": false,
56+
"required": [
57+
"read",
58+
"write",
59+
"delete"
60+
],
61+
"properties": {
62+
"read": {
63+
"type": "boolean",
64+
"description": "gives read access"
65+
},
66+
"write": {
67+
"type": "boolean",
68+
"description": "gives write access"
69+
},
70+
"delete": {
71+
"type": "boolean",
72+
"description": "gives deletion rights"
73+
}
74+
}
75+
}
76+
}
5077
},
5178
"creationDate": {
5279
"type": "string",
@@ -307,4 +334,4 @@
307334
}
308335
}
309336
}
310-
}
337+
}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
GroupAccessRights:
2+
description: defines acesss rights for the user
3+
type: object
4+
properties:
5+
read:
6+
type: boolean
7+
write:
8+
type: boolean
9+
delete:
10+
type: boolean
11+
required:
12+
- read
13+
- write
14+
- delete
15+
example:
16+
# Member
17+
- read: true
18+
write: false
19+
delete: false
20+
# Manager
21+
- read: true
22+
write: true
23+
delete: false
24+
# Administrator
25+
- read: true
26+
write: true
27+
delete: true
28+
29+
UsersGroup:
30+
type: object
31+
properties:
32+
gid:
33+
description: the group ID
34+
type: string
35+
label:
36+
description: the group name
37+
type: string
38+
description:
39+
description: the group description
40+
type: string
41+
thumbnail:
42+
description: url to the group thumbnail
43+
type: string
44+
format: uri
45+
access_rights:
46+
$ref: "#/GroupAccessRights"
47+
required:
48+
- gid
49+
- label
50+
- description
51+
- access_rights
52+
example:
53+
- gid: "27"
54+
label: "A user"
55+
description: "A very special user"
56+
thumbnail: https://user-images.githubusercontent.com/32800795/61083844-ff48fb00-a42c-11e9-8e63-fa2d709c8baf.png
57+
- gid: "1"
58+
label: "ITIS Foundation"
59+
description: "The Foundation for Research on Information Technologies in Society"
60+
thumbnail: https://user-images.githubusercontent.com/32800795/61083844-ff48fb00-a42c-11e9-8e63-fa2d709c8baf.png
61+
- gid: "0"
62+
label: "All"
63+
description: "Open to all users"
64+
thumbnail: https://user-images.githubusercontent.com/32800795/61083844-ff48fb00-a42c-11e9-8e63-fa2d709c8baf.png
65+
66+
UsersGroupEnveloped:
67+
type: object
68+
required:
69+
- data
70+
properties:
71+
data:
72+
$ref: "#/UsersGroup"
73+
error:
74+
nullable: true
75+
default: null
76+
77+
AllUsersGroups:
78+
type: object
79+
properties:
80+
me:
81+
$ref: "#/UsersGroup"
82+
organizations:
83+
type: array
84+
items:
85+
$ref: "#/UsersGroup"
86+
all:
87+
$ref: "#/UsersGroup"
88+
89+
AllUsersGroupsEnveloped:
90+
type: object
91+
required:
92+
- data
93+
properties:
94+
data:
95+
$ref: "#/AllUsersGroups"
96+
error:
97+
nullable: true
98+
default: null
99+
100+
GroupUser:
101+
type: object
102+
allOf:
103+
- type: object
104+
properties:
105+
first_name:
106+
type: string
107+
description: the user first name
108+
last_name:
109+
type: string
110+
description: the user last name
111+
login:
112+
type: string
113+
format: email
114+
description: the user login email
115+
gravatar_id:
116+
type: string
117+
description: the user gravatar id hash
118+
id:
119+
type: string
120+
description: the user id
121+
gid:
122+
type: string
123+
description: the user primary gid
124+
example:
125+
first_name: Mr
126+
last_name: Smith
127+
128+
gravatar_id: a1af5c6ecc38e81f29695f01d6ceb540
129+
id: "1"
130+
gid: "3"
131+
- $ref: "#/GroupAccessRights"
132+
133+
GroupUsersArrayEnveloped:
134+
type: object
135+
required:
136+
- data
137+
properties:
138+
data:
139+
type: array
140+
items:
141+
$ref: "#/GroupUser"
142+
error:
143+
nullable: true
144+
default: null
145+
146+
GroupUserEnveloped:
147+
type: object
148+
required:
149+
- data
150+
properties:
151+
data:
152+
$ref: "#/GroupUser"
153+
error:
154+
nullable: true
155+
default: null

api/specs/webserver/components/schemas/me.yaml

Lines changed: 18 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,32 @@ ProfileCommon:
66
last_name:
77
type: string
88
example:
9-
109
first_name: Pedro
1110
last_name: Crespo
1211

1312
ProfileInput:
1413
allOf:
15-
- $ref: '#/ProfileCommon'
14+
- $ref: "#/ProfileCommon"
1615
example:
1716
first_name: Pedro
1817
last_name: Crespo
1918

2019
ProfileOutput:
2120
allOf:
22-
- $ref: '#/ProfileCommon'
23-
- type: object
24-
properties:
25-
login:
26-
type: string
27-
format: email
28-
role:
29-
type: string
30-
groups:
31-
type: object
32-
properties:
33-
me:
34-
$ref: '#/UsersGroup'
35-
organizations:
36-
type: array
37-
items:
38-
$ref: '#/UsersGroup'
39-
all:
40-
$ref: '#/UsersGroup'
41-
gravatar_id:
42-
type: string
21+
- $ref: "#/ProfileCommon"
22+
- type: object
23+
properties:
24+
login:
25+
type: string
26+
format: email
27+
role:
28+
type: string
29+
groups:
30+
$ref: "./group.yaml#/AllUsersGroups"
31+
gravatar_id:
32+
type: string
4333
example:
4434
45-
first_name: Pedro
46-
last_name: Crespo
4735
role: Admin
4836
gravatar_id: 205e460b479e2e5b48aec07710c08d50
4937

@@ -53,32 +41,11 @@ ProfileEnveloped:
5341
- data
5442
properties:
5543
data:
56-
$ref: '#/ProfileOutput'
44+
$ref: "#/ProfileOutput"
5745
error:
5846
nullable: true
5947
default: null
6048

61-
62-
UsersGroup:
63-
type: object
64-
properties:
65-
gid:
66-
type: string
67-
label:
68-
type: string
69-
description:
70-
type: string
71-
example:
72-
- gid: '27'
73-
label: 'A user'
74-
description: 'A very special user'
75-
- gid: '1'
76-
label: 'ITIS Foundation'
77-
description: 'The Foundation for Research on Information Technologies in Society'
78-
- gid: '0'
79-
label: 'All'
80-
description: 'Open to all users'
81-
8249
Token:
8350
description: api keys for third party services
8451
type: object
@@ -97,28 +64,25 @@ Token:
9764
- service
9865
- token_key
9966
example:
100-
service: 'github-api-v1'
67+
service: "github-api-v1"
10168
token_key: N1BP5ZSpB
10269

103-
10470
TokenId:
10571
description: toke identifier
10672
type: string
10773
# format: uuid
10874

109-
11075
TokenEnveloped:
11176
type: object
11277
required:
11378
- data
11479
properties:
11580
data:
116-
$ref: '#/Token'
81+
$ref: "#/Token"
11782
error:
11883
nullable: true
11984
default: null
12085

121-
12286
TokensArrayEnveloped:
12387
type: object
12488
required:
@@ -127,7 +91,7 @@ TokensArrayEnveloped:
12791
data:
12892
type: array
12993
items:
130-
$ref: '#/Token'
94+
$ref: "#/Token"
13195
error:
13296
nullable: true
13397
default: null
@@ -138,7 +102,7 @@ TokenIdEnveloped:
138102
- data
139103
properties:
140104
data:
141-
$ref: '#/TokenId'
105+
$ref: "#/TokenId"
142106
error:
143107
nullable: true
144108
default: null

0 commit comments

Comments
 (0)