IMetabaseGroup.Role

Fore Syntax

Role: String;

Fore.NET Syntax

Role: String;

Description

The Role property determines the role of the Oracle DBMS, which is corresponded to this group of users.

Comments

The property is relevant only for domain groups of users. On adding a domain group, name of the group is specified in the repository security manager as the value of the Role property. If required, it can be changed.

Value of the Role property is used if the repository is entered by using domain authorization and security levels. On linking a domain user, which is missing in the repository security manager, entering of the user into the domain groups linked in the security manager, is checked. If the user is included into a domain group, correspondence of the role set for the group to the roles created on the DBMS server, is checked. If the server includes the specified role, the user is linked according to the security levels set for the group. Otherwise the appropriate error message is shown.

Fore Example

To execute the example, add a link to the Metabase system assembly.

Sub AddDomainGroup;
Var
    MB: IMetabase;
    MBSec: IMetabaseSecurity;
    Search: ISecuritySubjectsSearch;
    Subjects: ISecuritySubjects;
    Subject: ISecuritySubject;
Begin
    MB := MetabaseClass.Active;
    MBSec := MB.Security;
    //Object for searching users
    Search := MBSec.NewSubjectsSearch;
    Search.NameCriteria := "TestGroup";
    //Searching only domain users
    Search.AreaIncludeDB := False;
    Search.AreaIncludeNT := True;
    Search.SubjectCriteria(SecuritySubjectType.Group) := True;
    Search.ExecuteSearch;
    //Found users
    Subjects := Search.Subjects;
    If Subjects.Count > 0 Then
        //Setting parameters of adding a a domain group
        MBSec.CurrentDomainSubjectAddState(SecuritySubjectType.Group) :=
            DomainSubjectAddState.MakeExternalOn
            Or DomainSubjectAddState.ManageDBGrantsOff;
            //Adding a domain group
            Subject := MBSec.AddNTSubject(Subjects.Item(0));
            (Subject As IMetabaseGroup).Role := "GUEST";
        //Applying security policy
        MBSec.Apply;
    End If;
End Sub AddDomainGroup;

On executing the example, the TestGroup group is searched among the domain security subjects. If the group is found, it will be added to the list of the groups of repository security manager. The group will not be created on the DBMS server, permissions for repository objects will not be granted. The GUEST role will be determined for the group.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MBSec: IMetabaseSecurity;
    Search: ISecuritySubjectsSearch;
    Subjects: ISecuritySubjects;
    Subject: ISecuritySubject;
Begin
    MB := Params.Metabase;
    MBSec := MB.Security;
    //Object for searching users
    Search := MBSec.NewSubjectsSearch();
    Search.NameCriteria := "TestGroup";
    //Searching only domain users
    Search.AreaIncludeDB := False;
    Search.AreaIncludeNT := True;
    Search.SubjectCriteria[SecuritySubjectType.sstGroup] := True;
    Search.ExecuteSearch();
    //Found users
    Subjects := Search.Subjects;
    If Subjects.Count > 0 Then
        //Setting parameters of adding a a domain group
        MBSec.CurrentDomainSubjectAddState[SecuritySubjectType.sstGroup] :=
            DomainSubjectAddState.dsasMakeExternalOn
            Or DomainSubjectAddState.dsasManageDBGrantsOff;
            //Adding a domain group
            Subject := MBSec.AddNTSubject(Subjects.Item[0]);
            (Subject As IMetabaseGroup).Role := "GUEST";
        //Applying security policy
        MBSec.Apply();
    End If;
End Sub;

See also:

IMetabaseGroup