@@ -46,20 +46,6 @@ qx.Class.define("osparc.share.CollaboratorsService", {
4646 }
4747 return canWrite ;
4848 } ,
49-
50- getCollaboratorAccessRight : function ( ) {
51- return {
52- "execute" : true ,
53- "write" : false
54- } ;
55- } ,
56-
57- getOwnerAccessRight : function ( ) {
58- return {
59- "execute" : true ,
60- "write" : true
61- } ;
62- } ,
6349 } ,
6450
6551 members : {
@@ -68,9 +54,10 @@ qx.Class.define("osparc.share.CollaboratorsService", {
6854 return ;
6955 }
7056
57+ const readAccessRole = osparc . data . Roles . SERVICE [ "read" ] ;
7158 const newAccessRights = this . _serializedDataCopy [ "accessRights" ] ;
7259 gids . forEach ( gid => {
73- newAccessRights [ gid ] = this . self ( ) . getCollaboratorAccessRight ( ) ;
60+ newAccessRights [ gid ] = readAccessRole . accessRights ;
7461 } ) ;
7562 osparc . store . Services . patchServiceData ( this . _serializedDataCopy , "accessRights" , newAccessRights )
7663 . then ( ( ) => {
@@ -124,11 +111,12 @@ qx.Class.define("osparc.share.CollaboratorsService", {
124111 } ,
125112
126113 _promoteToEditor : function ( collaborator , item ) {
114+ const writeAccessRole = osparc . data . Roles . SERVICE [ "write" ] ;
127115 this . __make (
128116 collaborator [ "gid" ] ,
129- this . self ( ) . getOwnerAccessRight ( ) ,
130- this . tr ( `Successfully promoted to ${ osparc . data . Roles . SERVICE [ "write" ] . label } ` ) ,
131- this . tr ( `Something went wrong while promoting to ${ osparc . data . Roles . SERVICE [ "write" ] . label } ` ) ,
117+ writeAccessRole . accessRights ,
118+ this . tr ( `Successfully promoted to ${ writeAccessRole . label } ` ) ,
119+ this . tr ( `Something went wrong while promoting to ${ writeAccessRole . label } ` ) ,
132120 item
133121 ) ;
134122 } ,
@@ -138,11 +126,12 @@ qx.Class.define("osparc.share.CollaboratorsService", {
138126 } ,
139127
140128 _demoteToUser : function ( collaborator , item ) {
129+ const readAccessRole = osparc . data . Roles . SERVICE [ "read" ] ;
141130 this . __make (
142131 collaborator [ "gid" ] ,
143- this . self ( ) . getCollaboratorAccessRight ( ) ,
144- this . tr ( `Successfully demoted to ${ osparc . data . Roles . SERVICE [ "read" ] . label } ` ) ,
145- this . tr ( `Something went wrong while demoting ${ osparc . data . Roles . SERVICE [ "read" ] . label } ` ) ,
132+ readAccessRole . accessRights ,
133+ this . tr ( `Successfully demoted to ${ readAccessRole . label } ` ) ,
134+ this . tr ( `Something went wrong while demoting ${ readAccessRole . label } ` ) ,
146135 item
147136 ) ;
148137 } ,
0 commit comments