3D PLM PPR Hub Open Gateway |
Knowledge Modeler |
Managing Parameter RightsHow to specify access rights on parameters |
Use Case |
AbstractThis article explains how to manage the parameter access rights. |
The literal feature platform manages the parameter rights in two steps:
In this use case, you will only learn how to specify access rights on parameters.
[Top]
CAALifParameterRights is a use case of the CAALiteralFeatures.edu framework that illustrates KnowledgeInterfaces framework capabilities.
[Top]
This use case creates two integer type parameters and set their access rights.
In a batch program which does not involve any parameter editor, you can specify access rights but they are not really active. To test the right access effectiveness. you must plug an editor to your application.
[Top]
To launch CAALifParameterRights, you will need to set up the build time environment, then compile CAALifParameterRights along with its prerequisites, set up the run time environment, and then execute the use case which main program is CAALifParametersMain. This program encompasses several use cases [1].
[Top]
The CAALifParameterRights use case is made of the CAALifParameterRights.cpp file located in the CAALifParameters.m module of the CAALiteralFeatures.edu framework:
Windows | InstallRootDirectory\CAALiteralFeatures.edu\CAALifParameters.m\ |
Unix | InstallRootDirectory/CAALiteralFeatures.edu/CAALifParameters.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
The main program related to this file is CAALifParametersMain.
[Top]
CAALifParameterRights is made up of xx steps:
[Top]
The "intParam0" and "intParam1" parameters are created as persistent parameters [2].
[Top]
The default parameter rights are retrieved by using the
CATICkeParm::UserAccess method.
CATICkeParm_var spP1 = ... ; cout << "Default rights (3 expected - readOnly)" << endl; cout << int(spP1->UserAccess ()) << endl; cout << "Default rights (0 expected)" << endl; cout << int(spP1->IsReadOnly () ) << endl; |
By default a parameter is created with ReadWrite access mode. The access rights are defined by the enum below:
enum UserAccessMode { NotSeen = 0, ReadOnly = 1, WriteOnly = 2, ReadWrite = 3, User = 4 } |
In addition to the usual access rights, the literals support the NotSeen access right whereby you can specify that a parameter can only be used by the application developer. The NotSeen access right has nothing to do with the Hidden properties which is managed by the end-user.
You can also use the CATICkeParm::IsReadOnly method to determine the parameter access rights.
[Top]
... spP1->SetUserAccess(ReadOnly); spP2->SetUserAccess(ReadOnly); ... |
The "intParam0" access right is set to ReadOnly by using the CATICkeParm::SetUserAccess method which takes as its argument one of the items of the UserAccessMode enum.
The "intParam0" parameter is constrained by the p1 = 3 * p2 - 2 formula although it is declared as a ReadOnly parameter. The formula is created and the "intParam0" parameter is updated according to the formula.
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[2] | Using Persistent Parameters |
[Top] |
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.