Token: IAccessToken;
The Token property returns the user mandatory access parameters.
Sub UserProc;
Var
MB: IMetabase;
MbSec: IMetabaseSecurity;
Lic: Object;
User: IMetabaseUser;
Tok: IAccessToken;
SecCat: ISecurityCategory;
SecLevel: ISecurityLevel;
Begin
MB := MetabaseClass.Active;
// Get license to be able to work with the security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MbSec := MB.Security;
// Get user
User := MbSec.Users.Item(0);
Tok := User.Token;
SecCat := MB.Security.Policy.MandatoryAccess.Category(0);
SecLevel := SecCat.Level(3);
Tok.ClassificationLabel(SecCat) := SecLevel;
// Apply changes
MbSec.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the fourth level of access is assigned for the first category of the mandatory control for the specified user.
See also: