IDomains.Add

Syntax

Add(Name: String): IDomain;

Parameters

Name is a name of a domain that is being added.

Description

The Add method adds a domain to the collection.

Example

Executing the example requires a form and a button named Button1 on this form. A user named USER_1 was created in a security manager.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

MB: IMetabase;

Sec: IMetabaseSecurity;

User: IMetabaseUser;

Dms: IDomains;

Dm: IDomain;

Sts: IStations;

St: IStation;

Begin

MB := MetabaseClass.Active;

Sec := MB.Security;

User := Sec.ResolveName("USER_1") As IMetabaseUser;

Sts := User.Stations;

Dms := Sts.Domains;

Dm := Dms.Add("PROGNOZ");

Sts := Dm.Stations;

Sts.Refresh;

St := Sts.FindByName("TEST_PC");

St.Included := True;

Sec.Apply;

End Sub Button1OnClick;

After executing the example pressing the button will change access policy for the USER_1 user. Access from this user account will be allowed only from the TEST_PC workstation, that is a part of the PROGNOZ domain.

See also:

IDomains