Skip to content

Commit a190275

Browse files
author
Andrei Neagu
committed
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-running-tasks-refactor-6
2 parents a8c6353 + 24afa1f commit a190275

File tree

7 files changed

+22
-21
lines changed

7 files changed

+22
-21
lines changed

services/static-webserver/client/source/class/osparc/data/Permissions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,11 @@ qx.Class.define("osparc.data.Permissions", {
324324
},
325325

326326
isProductOwner: function() {
327-
return this.getRole() === "product_owner";
327+
return ["admin", "product_owner"].includes(this.getRole());
328328
},
329329

330330
isAdmin: function() {
331-
return this.getRole() === "admin";
331+
return ["admin"].includes(this.getRole());
332332
},
333333
}
334334
});

services/static-webserver/client/source/class/osparc/navigation/UserMenu.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ qx.Class.define("osparc.navigation.UserMenu", {
5151
control.addListener("execute", () => osparc.desktop.account.MyAccountWindow.openWindow(), this);
5252
this.add(control);
5353
break;
54-
case "admin-center":
55-
control = new qx.ui.menu.Button(this.tr("Admin Center"));
56-
control.addListener("execute", () => osparc.admin.AdminCenterWindow.openWindow(), this);
54+
case "tester-center":
55+
control = new qx.ui.menu.Button(this.tr("Tester Center"));
56+
control.addListener("execute", () => osparc.tester.TesterCenterWindow.openWindow(), this);
5757
this.add(control);
5858
break;
5959
case "po-center":
6060
control = new qx.ui.menu.Button(this.tr("PO Center"));
6161
control.addListener("execute", () => osparc.po.POCenterWindow.openWindow(), this);
6262
this.add(control);
6363
break;
64-
case "tester-center":
65-
control = new qx.ui.menu.Button(this.tr("Tester Center"));
66-
control.addListener("execute", () => osparc.tester.TesterCenterWindow.openWindow(), this);
64+
case "admin-center":
65+
control = new qx.ui.menu.Button(this.tr("Admin Center"));
66+
control.addListener("execute", () => osparc.admin.AdminCenterWindow.openWindow(), this);
6767
this.add(control);
6868
break;
6969
case "billing-center":
@@ -144,14 +144,14 @@ qx.Class.define("osparc.navigation.UserMenu", {
144144
this.getChildControl("log-in");
145145
} else {
146146
this.getChildControl("user-center");
147-
if (osparc.data.Permissions.getInstance().isAdmin()) {
148-
this.getChildControl("admin-center");
147+
if (osparc.data.Permissions.getInstance().isTester()) {
148+
this.getChildControl("tester-center");
149149
}
150150
if (osparc.data.Permissions.getInstance().isProductOwner()) {
151151
this.getChildControl("po-center");
152152
}
153-
if (osparc.data.Permissions.getInstance().isTester()) {
154-
this.getChildControl("tester-center");
153+
if (osparc.data.Permissions.getInstance().isAdmin()) {
154+
this.getChildControl("admin-center");
155155
}
156156
if (osparc.desktop.credits.Utils.areWalletsEnabled()) {
157157
this.getChildControl("billing-center");
@@ -196,14 +196,14 @@ qx.Class.define("osparc.navigation.UserMenu", {
196196
this.getChildControl("log-in");
197197
} else {
198198
this.getChildControl("user-center");
199-
if (osparc.data.Permissions.getInstance().isAdmin()) {
200-
this.getChildControl("admin-center");
199+
if (osparc.data.Permissions.getInstance().isTester()) {
200+
this.getChildControl("tester-center");
201201
}
202202
if (osparc.data.Permissions.getInstance().isProductOwner()) {
203203
this.getChildControl("po-center");
204204
}
205-
if (osparc.data.Permissions.getInstance().isTester()) {
206-
this.getChildControl("tester-center");
205+
if (osparc.data.Permissions.getInstance().isAdmin()) {
206+
this.getChildControl("admin-center");
207207
}
208208
if (osparc.desktop.credits.Utils.areWalletsEnabled()) {
209209
this.getChildControl("billing-center");

services/static-webserver/client/source/class/osparc/po/UsersPending.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ qx.Class.define("osparc.po.UsersPending", {
340340
__createRejectButton: function(email) {
341341
const button = new osparc.ui.form.FetchButton("Reject");
342342
button.addListener("execute", () => {
343-
const msg = `Are you sure you want to reject ${email}.<br>The operation cannot be reverted"`;
343+
const msg = `Are you sure you want to reject ${email}.<br>The operation cannot be reverted`;
344344
const win = new osparc.ui.window.Confirmation(msg).set({
345345
caption: "Reject User",
346346
confirmText: "Reject",

services/web/server/src/simcore_service_webserver/security/_authz_access_roles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class PermissionDict(TypedDict, total=False):
120120
"resource-usage.write",
121121
"storage.files.sync",
122122
],
123-
inherits=[UserRole.TESTER],
123+
inherits=[UserRole.PRODUCT_OWNER],
124124
),
125125
}
126126

services/web/server/tests/unit/with_dbs/03/invitations/test_products_rest_invitations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
(UserRole.USER, status.HTTP_403_FORBIDDEN),
3535
(UserRole.TESTER, status.HTTP_403_FORBIDDEN),
3636
(UserRole.PRODUCT_OWNER, status.HTTP_200_OK),
37-
(UserRole.ADMIN, status.HTTP_403_FORBIDDEN),
37+
(UserRole.ADMIN, status.HTTP_200_OK),
3838
],
3939
)
4040
async def test_role_access_to_generate_invitation(

services/web/server/tests/unit/with_dbs/03/invitations/test_users_accounts_rest_registration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ async def mock_send_message(msg):
9595
*(
9696
(role, status.HTTP_403_FORBIDDEN)
9797
for role in UserRole
98-
if role not in {UserRole.PRODUCT_OWNER, UserRole.ANONYMOUS}
98+
if role not in {UserRole.PRODUCT_OWNER, UserRole.ADMIN, UserRole.ANONYMOUS}
9999
),
100100
(UserRole.PRODUCT_OWNER, status.HTTP_200_OK),
101+
(UserRole.ADMIN, status.HTTP_200_OK),
101102
],
102103
)
103104
async def test_access_rights_on_search_users_only_product_owners_can_access(

services/web/server/tests/unit/with_dbs/04/products/test_products_rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def test_get_product_price_when_undefined(
5151
(UserRole.USER, status.HTTP_403_FORBIDDEN),
5252
(UserRole.TESTER, status.HTTP_403_FORBIDDEN),
5353
(UserRole.PRODUCT_OWNER, status.HTTP_200_OK),
54-
(UserRole.ADMIN, status.HTTP_403_FORBIDDEN),
54+
(UserRole.ADMIN, status.HTTP_200_OK),
5555
],
5656
)
5757
async def test_get_product_access_rights(

0 commit comments

Comments
 (0)