Using Namespaces and Access Modifiers
Rules for Access Modifier
Entities with None access modifier are accessible from all other Entities.
Private Entities are accessible only from their own projects.
Restricted Entities are accessible only from same project and allowed namespaces.
Characteristics with None access modifier on an Entity which also has None access modifier are accessible from all other Entities.
Characteristics with None access modifier on Restricted Entity are accessible only from allowed namespaces.
Characteristics with None access modifier on Private Entity are accessible only from project in which they're defined.
Restricted Characteristics are accessible only from same project and allowed namespaces.
Private Characteristics are accessible only from project in which they're defined.
If an entity is PRIVATE, characterictics can not have RESTRICTED scope.
Internal Characteristics are accessible only from the Entity to which Characteristic belongs.
If an entity or a characteristic is created, it will inherit the scope from its parent.
Access Modifiers mentioned in sequence of their broadness.
None >> Restricted >> Private >> Internal
None is broader than Restricted, Private and Internal.
Restricted is broader than Private and Internal.
Private is broader than Internal.
Internal is the narrowest access modifier.
Examples
If [P2#Solution].[T2#Thing] is trying to call [P1[n1.n2.n3]#Component].[T1#Thing], it will allow, because if an entity or a characteristic is PUBLIC within a project, with a namespace or without namespace, it can be called/used by any other entity or characteristic within the same project or a project with different namespace.
If [P2[n4.n5.n6]#BuildingBlock].[T2#Thing] is trying to call [P1[n1.n2.n3]#Component].[T1#Thing], it will allow, because if an entity or a characteristic is PUBLIC within a project, with a namespace or without namespace, it can be called.
If [P2#Solution].[TT2#ThingTemplate] is trying to call [P1[n1.n2.n3]#Component].[TT1{PRIVATE}#ThingTemplate], it will not allow, because if an entity or a characteristic is PRIVATE within a project, with a namespace or without namespace, it can be called/used by any other entity or characteristic within the same project only.
If [P2[n4.n5.n6]#BuildingBlock].[TS2#ThingShape] is trying to call [P1[n1.n2.n3]#Component].[TS1{PRIVATE}#ThingShape], it will not allow, because if an entity or a characteristic is PRIVATE within a project, with a namespace or without namespace, it can be called/used by any other entity or characteristic within the same project only.
If [P1[n1.n2.n3]#Component].[T2{PRIVATE}#Thing].[S1#Service] is trying to call [P1[n1.n2.n3]#Component].[TT1{PRIVATE}#ThingTemplate], it will allow because it can be called/used by any other entity or characteristic within the same project only.
If [P2[n1.n2.n3]#BuildingBlock].[TT2#ThingTemplate].[Prop2{PRIVATE}#Property] is trying to call [P1[n1.n2.n3]#BuildingBlock].[T1{RESTRICTED[n1.n2]}#Thing].[S1{RESTRICTED[n1.n2]}#Service], it will not allow, because characteristics with PUBLIC access modifier on RESTRICTED Entity are accessible only from allowed namespaces.
If [P2[n1.n2.n3]#BuildingBlock].[TT2#ThingTemplate] is trying to call [P1[n1.n2.n3]#BuildingBlock].[T1{RESTRICTED[n1.n2]}#Thing], it will not allow, because restricted entities and characteristic are accessible only from same project and allowed namespaces.
If [P1[n1.n2.n3]#BuildingBlock].[T1{RESTRICTED[n1.n2]}#Thing] is trying to call [P2[n1.n2.n3]#BuildingBlock].[TT2#ThingTemplate], it will allow, because entity or characteristic with None (PUBLIC) scope can be accessed by anyone.
If P1[n1.n2.n3]#BuildingBlock].[T2{RESTRICTED[n1.n2]}#Thing].[Prop2{RESTRICTED[n1.n2]}#Property] is trying to call [P1[n1.n2.n3]#BuildingBlock].[T1{RESTRICTED[n1.n2]}#Thing].[S1{INTERNAL}#Service], it will not allow, because internal characteristics are accessible only from the entity to which characteristic belongs.
If [P1[n1.n2.n3]#BuildingBlock].[T1{RESTRICTED[n1.n2]}#Thing].[Prop1{PRIVATE}#Property] is trying to call [P1[n1.n2.n3]#BuildingBlock].[T1{RESTRICTED[n1.n2]}#Thing].[S1{INTERNAL}#Service], it will be allowed, because internal characteristics are accessible only from the entity to which characteristic belongs.
Was this helpful?