Skip to content

Commit 850a35b

Browse files
committed
SSS-328
1 parent b971a5c commit 850a35b

File tree

19 files changed

+128
-68
lines changed

19 files changed

+128
-68
lines changed

adapter/adapter.rest/adapter.rest.v2/src/main/java/at/tugraz/sss/adapter/rest/v2/learnep/SSRESTLearnEp.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
import at.kc.tugraz.ss.serv.datatypes.learnep.datatypes.ret.SSLearnEpsLockHoldRet;
6161
import at.kc.tugraz.ss.serv.voc.conf.SSVocConf;
6262
import at.tugraz.sss.adapter.rest.v2.SSRestMainV2;
63-
import at.tugraz.sss.serv.SSServOpE;
6463
import at.tugraz.sss.serv.SSStrU;
6564
import at.tugraz.sss.serv.SSUri;
6665
import at.tugraz.sss.serv.SSVarNames;
@@ -227,6 +226,7 @@ public Response learnEpVersionCurrentSet(
227226
new SSLearnEpVersionCurrentSetPar(
228227
null,
229228
SSUri.get(learnEpVersion, SSVocConf.sssUri),
229+
true,
230230
true);
231231

232232
}catch(Exception error){
@@ -258,6 +258,7 @@ public Response learnEpCreate(
258258
null,
259259
input.label,
260260
input.description,
261+
true,
261262
true);
262263

263264
}catch(Exception error){
@@ -289,6 +290,7 @@ public Response learnEpVersionCreate(
289290
new SSLearnEpVersionCreatePar(
290291
null,
291292
SSUri.get(learnEp, SSVocConf.sssUri),
293+
true,
292294
true);
293295

294296
}catch(Exception error){
@@ -361,6 +363,7 @@ public Response learnEpVersionCircleAdd(
361363
input.yR,
362364
input.xC,
363365
input.yC,
366+
true,
364367
true);
365368

366369
}catch(Exception error){
@@ -397,6 +400,7 @@ public Response learnEpVersionEntityAdd(
397400
input.entity,
398401
input.x,
399402
input.y,
403+
true,
400404
true);
401405

402406
}catch(Exception error){
@@ -437,6 +441,7 @@ public Response learnEpVersionCircleUpdate(
437441
input.yR,
438442
input.xC,
439443
input.yC,
444+
true,
440445
true);
441446

442447
}catch(Exception error){
@@ -473,6 +478,7 @@ public Response learnEpVersionEntityUpdate(
473478
input.entity,
474479
input.x,
475480
input.y,
481+
true,
476482
true);
477483

478484
}catch(Exception error){
@@ -504,6 +510,7 @@ public Response learnEpVersionCircleRemove(
504510
new SSLearnEpVersionCircleRemovePar(
505511
null,
506512
SSUri.get(learnEpCircle, SSVocConf.sssUri),
513+
true,
507514
true);
508515

509516
}catch(Exception error){
@@ -535,6 +542,7 @@ public Response learnEpVersionEntityRemove(
535542
new SSLearnEpVersionEntityRemovePar(
536543
null,
537544
SSUri.get(learnEpEntity, SSVocConf.sssUri),
545+
true,
538546
true);
539547

540548
}catch(Exception error){
@@ -570,6 +578,7 @@ public Response learnEpVersionTimelineStateSet(
570578
SSUri.get(learnEpVersion, SSVocConf.sssUri),
571579
input.startTime,
572580
input.endTime,
581+
true,
573582
true);
574583

575584
}catch(Exception error){
@@ -600,7 +609,8 @@ public Response learnEpVersionTimelineStateGet(
600609
par =
601610
new SSLearnEpVersionTimelineStateGetPar(
602611
null,
603-
SSUri.get(learnEpVersion, SSVocConf.sssUri));
612+
SSUri.get(learnEpVersion, SSVocConf.sssUri),
613+
true);
604614

605615
}catch(Exception error){
606616
return Response.status(422).build();
@@ -630,7 +640,8 @@ public Response learnEpsLockHold(
630640
par =
631641
new SSLearnEpsLockHoldPar(
632642
null,
633-
SSUri.get(SSStrU.splitDistinctWithoutEmptyAndNull(learnEps, SSStrU.comma), SSVocConf.sssUri));
643+
SSUri.get(SSStrU.splitDistinctWithoutEmptyAndNull(learnEps, SSStrU.comma), SSVocConf.sssUri),
644+
true);
634645

635646
}catch(Exception error){
636647
return Response.status(422).build();

serv/serv.impl/src/main/java/at/tugraz/sss/serv/SSCopyEntityI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
package at.tugraz.sss.serv;
2222

2323
public interface SSCopyEntityI {
24-
public void copyEntity(final SSEntity entity, final SSEntityCopyPar par) throws Exception;
24+
public void copyEntity(final SSEntity entity, final SSEntityCopyPar par) throws Exception;
2525
}

servs/circle/circle.impl/src/main/java/at/kc/tugraz/ss/circle/impl/fct/misc/SSCircleMiscFct.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public void copyCircleToNewCircle(
289289
entityCopiedPar =
290290
new SSEntityCopiedPar(
291291
par.user,
292-
forUser,
292+
forUser, //targetUser
293293
circle, //entity
294294
circle.entities, //entities
295295
copyCircleURI, //targetEntity
@@ -315,7 +315,7 @@ public void copyCircleToNewCircle(
315315
entityCopiedPar =
316316
new SSEntityCopiedPar(
317317
par.user,
318-
forUser,
318+
forUser, //targetUser
319319
circle, //entity
320320
circle.users, //entities
321321
copyCircleURI, //targetEntity
@@ -349,7 +349,7 @@ public void copyCircleToNewCircle(
349349
entityCopiedPar =
350350
new SSEntityCopiedPar(
351351
par.user,
352-
forUser,
352+
forUser, //targetUser
353353
circle, //entity
354354
originUsers, //entities
355355
copyCircleURI, //targetEntity

servs/entity/entity.impl/src/main/java/at/kc/tugraz/ss/serv/datatypes/entity/impl/SSEntityImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,11 @@ public SSUri entityUpdate(final SSEntityUpdatePar par) throws Exception{
470470
throw new SSErr(SSErrE.parameterMissing);
471471
}
472472

473-
if(!SSServCallerU.canUserRead(par.user, par.entity)){
474-
throw new SSErr(SSErrE.userNotAllowedToAccessEntity);
473+
if(par.withUserRestriction){
474+
475+
if(!SSServCallerU.canUserRead(par.user, par.entity)){
476+
throw new SSErr(SSErrE.userNotAllowedToAccessEntity);
477+
}
475478
}
476479

477480
final SSEntity entity = sqlFct.getEntity(par.entity);

servs/integrationtest/integrationtest.impl/src/main/java/at/tugraz/sss/servs/integrationtest/knowbraintaggingstudy2015/SSIntegrationTestBitsAndPiecesStudyFall2015.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,15 @@ public SSUri createLearnEpWithEntitiesAndCircles(
260260
user,
261261
SSLabel.get("learn ep 1"),
262262
SSTextComment.get("description"),
263+
true,
263264
false));
264265

265266
final SSUri learnEpVersion =
266267
learnEpServ.learnEpVersionCreate(
267268
new SSLearnEpVersionCreatePar(
268269
user,
269270
learnEp,
271+
true,
270272
false));
271273

272274
final SSUri circle =
@@ -281,6 +283,7 @@ public SSUri createLearnEpWithEntitiesAndCircles(
281283
2F,
282284
3F,
283285
4F,
286+
true,
284287
false));
285288

286289
final SSUri entity =
@@ -291,6 +294,7 @@ public SSUri createLearnEpWithEntitiesAndCircles(
291294
SSUri.get("http://linkToEnttiy"),
292295
10F,
293296
11F,
297+
true,
294298
false));
295299

296300
return learnEp;
@@ -375,6 +379,7 @@ public void updateLearnEpEntity(
375379
SSUri.get("http://entity2"),
376380
100F,
377381
100F,
382+
true,
378383
false));
379384

380385
entityServ.entityUpdate(
@@ -416,6 +421,7 @@ public void updateLearnEpCircle(
416421
3F,
417422
3F,
418423
3F,
424+
true,
419425
false));
420426

421427
}catch(Exception error){

servs/learnep/learnep.datatypes/src/main/java/at/kc/tugraz/ss/serv/datatypes/learnep/datatypes/par/SSLearnEpCreatePar.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@ public SSLearnEpCreatePar(){}
5353
public SSLearnEpCreatePar(
5454
final SSUri user,
5555
final SSLabel label,
56-
final SSTextComment description,
56+
final SSTextComment description,
57+
final Boolean withUserRestriction,
5758
final Boolean shouldCommit){
5859

5960
super(SSServOpE.learnEpCreate, null, user);
6061

61-
this.label = label;
62-
this.description = description;
63-
this.shouldCommit = shouldCommit;
62+
this.label = label;
63+
this.description = description;
64+
this.withUserRestriction = withUserRestriction;
65+
this.shouldCommit = shouldCommit;
6466
}
6567
}

servs/learnep/learnep.datatypes/src/main/java/at/kc/tugraz/ss/serv/datatypes/learnep/datatypes/par/SSLearnEpVersionCircleAddPar.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ public SSLearnEpVersionCircleAddPar(
6565
final Float yR,
6666
final Float xC,
6767
final Float yC,
68+
final Boolean withUserRestriction,
6869
final Boolean shouldCommit){
6970

7071
super(SSServOpE.learnEpVersionCircleAdd, null, user);
7172

72-
this.learnEpVersion = learnEpVersion;
73-
this.label = label;
74-
this.xLabel = xLabel;
75-
this.yLabel = yLabel;
76-
this.xR = xR;
77-
this.yR = yR;
78-
this.xC = xC;
79-
this.yC = yC;
80-
this.shouldCommit = shouldCommit;
73+
this.learnEpVersion = learnEpVersion;
74+
this.label = label;
75+
this.xLabel = xLabel;
76+
this.yLabel = yLabel;
77+
this.xR = xR;
78+
this.yR = yR;
79+
this.xC = xC;
80+
this.yC = yC;
81+
this.withUserRestriction = withUserRestriction;
82+
this.shouldCommit = shouldCommit;
8183
}
8284
}

servs/learnep/learnep.datatypes/src/main/java/at/kc/tugraz/ss/serv/datatypes/learnep/datatypes/par/SSLearnEpVersionCircleRemovePar.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ public SSLearnEpVersionCircleRemovePar(){}
4242
public SSLearnEpVersionCircleRemovePar(
4343
final SSUri user,
4444
final SSUri learnEpCircle,
45+
final Boolean withUserRestriction,
4546
final Boolean shouldCommit){
4647

4748
super(SSServOpE.learnEpVersionCircleRemove, null, user);
4849

49-
this.learnEpCircle = learnEpCircle;
50-
this.shouldCommit = shouldCommit;
50+
this.learnEpCircle = learnEpCircle;
51+
this.withUserRestriction = withUserRestriction;
52+
this.shouldCommit = shouldCommit;
5153
}
5254
}

servs/learnep/learnep.datatypes/src/main/java/at/kc/tugraz/ss/serv/datatypes/learnep/datatypes/par/SSLearnEpVersionCircleUpdatePar.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ public SSLearnEpVersionCircleUpdatePar(
6565
final Float yR,
6666
final Float xC,
6767
final Float yC,
68+
final Boolean withUserRestriction,
6869
final Boolean shouldCommit){
6970

7071
super(SSServOpE.learnEpVersionCircleUpdate, null, user);
7172

72-
this.learnEpCircle = learnEpCircle;
73-
this.label = label;
74-
this.xLabel = xLabel;
75-
this.yLabel = yLabel;
76-
this.xR = xR;
77-
this.yR = yR;
78-
this.xC = xC;
79-
this.yC = yC;
80-
this.shouldCommit = shouldCommit;
73+
this.learnEpCircle = learnEpCircle;
74+
this.label = label;
75+
this.xLabel = xLabel;
76+
this.yLabel = yLabel;
77+
this.xR = xR;
78+
this.yR = yR;
79+
this.xC = xC;
80+
this.yC = yC;
81+
this.withUserRestriction = withUserRestriction;
82+
this.shouldCommit = shouldCommit;
8183
}
8284
}

servs/learnep/learnep.datatypes/src/main/java/at/kc/tugraz/ss/serv/datatypes/learnep/datatypes/par/SSLearnEpVersionCreatePar.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ public SSLearnEpVersionCreatePar(){}
4242
public SSLearnEpVersionCreatePar(
4343
final SSUri user,
4444
final SSUri learnEp,
45+
final Boolean withUserRestriction,
4546
final Boolean shouldCommit){
4647

4748
super(SSServOpE.learnEpVersionCreate, null, user);
4849

49-
this.learnEp = learnEp;
50-
this.shouldCommit = shouldCommit;
50+
this.learnEp = learnEp;
51+
this.withUserRestriction = withUserRestriction;
52+
this.shouldCommit = shouldCommit;
5153
}
5254
}

0 commit comments

Comments
 (0)