@@ -21,7 +21,6 @@ export function createBasicObject(basicShape: IBasicShape, dynamicElements : Map
21
21
let fillColor = ( basicShape . has_inside_color ) ? basicShape . fill_color : 'none' ;
22
22
// Tooltip
23
23
let tooltip = basicShape . tooltip ;
24
- let relPoints = [ ] as number [ ] [ ] ;
25
24
26
25
// Create an object with the initial parameters
27
26
let initial : IBasicObject = {
@@ -59,6 +58,9 @@ export function createBasicObject(basicShape: IBasicShape, dynamicElements : Map
59
58
transformedCornerCoord : absCornerCoord ,
60
59
relCoord : relCoord ,
61
60
relMidpointCoord : relMidpointCoord ,
61
+ // Access variables
62
+ writeAccess : true ,
63
+ readAccess : true
62
64
}
63
65
64
66
// Processing the variables for visual elements
@@ -437,5 +439,38 @@ export function createBasicObject(basicShape: IBasicShape, dynamicElements : Map
437
439
}
438
440
} ) ;
439
441
442
+ // Define the object access variables
443
+ Object . defineProperty ( initial , "writeAccess" , {
444
+ get : function ( ) {
445
+ let current = ComSocket . singleton ( ) . oVisuVariables . get ( ".currentuserlevel" ) ! . value ;
446
+ let currentNum = Number ( current ) ;
447
+ if ( currentNum !== NaN ) {
448
+ if ( basicShape . access_levels [ currentNum ] . includes ( "w" ) ) {
449
+ return true
450
+ } else {
451
+ return false
452
+ }
453
+ } else {
454
+ return ( false )
455
+ }
456
+ }
457
+ } ) ;
458
+
459
+ Object . defineProperty ( initial , "readAccess" , {
460
+ get : function ( ) {
461
+ let current = ComSocket . singleton ( ) . oVisuVariables . get ( ".currentuserlevel" ) ! . value ;
462
+ let currentNum = Number ( current ) ;
463
+ if ( currentNum !== NaN ) {
464
+ if ( basicShape . access_levels [ currentNum ] . includes ( "r" ) ) {
465
+ return true
466
+ } else {
467
+ return false
468
+ }
469
+ } else {
470
+ return ( false )
471
+ }
472
+ }
473
+ } ) ;
474
+
440
475
return initial ;
441
476
}
0 commit comments