Galaktikasoft

Workplace Module

When developing a XAF application, Security System splits users into groups according to roles. XAF concept provides that the Application Model can be configured for all users (Model.xafml file) in whole or individually for each user (Model.User.xafml file). For these tasks, a special tool is provided - Model Editor.

When automating a number of business processes an additional requirement is present. It is very useful to be able to configure the Application Model to a user group, i.e. create and configure Work Place. Moreover, users of this Work Place may be included in various roles and have different sets of permissions.

Xafari Workplace Module adds an extra layer in the Application Model, which allows you to configure user Work Place. Each user can have access to many Work Places. In turn, the user model differences are stored individually for each user and for a particular Work Place.

In this post, we will examine Xafari Work Place functionality.

Application with Work Places

To add Xafari Workplace functionality to a XAF application, execute the following steps:

It is required to use SecurityStrategyComplex.

If you are logged on as Administrator, then the following navigation items will be available:

To edit users and roles user must have special permissions (see Security System).

Workplace file

The administrator can edit Model and Model Workplace "Administrator". The basic Model is stored in a Model.xafml file in the project directory. And Model Workplace file does not exist yet. There are three ways to create Workplace file:

In this example, create a file using the application. The application has been started by us for the first time and the Model Workplace “Administrator” file was not created, it is not yet there. In any case, the system is started and the selected Workplace is set, but Workplace not stores any settings.

To edit Model Workplace “Administrator” choose Tools->Edit Workplace Model Workplace "Administrator":

Model Editor will be invoked to edit current Workplace and Model.Workplace.Administrator.xafml file will be created. You can see it on the drive.

By default, Workplace files are stored in the application folder. To change their location, use the config file. Set value parameter to required folder.

add key="WorkplaceFilesPath" value =" " 

Demonstration

Add new classifiers to the application:


Add new role, name it Manager. For the new role, set Navigation Item Access Permissions as follows: deny access to the XafariSecuritySystemRole, User and My Details items.

Add a new user, name it Ivanov. Assign Manager and Users roles to the new user.

Invoke Model Editor to edit Application Model. Navigate to the Xafari|Roles node and add new Role, name it Manager. The following image shows Xafari|Roles node.

Restart application, choose Standard Authentication and set Ivanov logon parameters:

Choose Workplace Manager:

The application window is generated on the basis of the standard Application Model (Model.xafml file) and the Manager role:

In the main menu, select Tools->Edit Workplace Model Workplace “Manager”. Focus Options node, set UIType property to the "TabbedMDI" value and set Skin property to the "Lilian". After that Manager Workplace for the Ivanov user will be displayed as follows.

Now, let's change the Users Workplace to the user Ivanov. In the main menu select File->Workplace and set Users:

Select Tools->Edit Workplace Model Workplace “Users”. Add My Details Navigation Item, name it Ivanov and save settings. Users Workplace for the Ivanov user will be displayed as follows:

For each of the edited Workplace, a corresponding .xaml file is originated:

Notes:

If add .xafml files to the Visual Studio project directory, it can be hidden. In this case, perform "Include In Project" operation.

When developing a Web application, there are only two ways to create (edit) Workplace .xafml files: