Security subsystem

The Security subsystem's architecture is described in the following section. This section dwells only on the server program API.

The main entity we will interact with is Security Provider that implements the ISecurityProvider interface, which can be accessed via the DWKitRuntime.

var security = DWKitRuntime.Security;

The operation we will constantly execute is:

  • getting a current authorized user
User user = DWKitRuntime.Security.CurrentUser;

The returned object with the user description contains the following information:

- `Id`, `Name`, `Email` of a authorized user
- `ImpersonatedUserId`, `ImpersonatedUserName` are filled in and differ from null, if the current user executes an operation for another user.
  • methods of checking general permissions and permissions for a certain form.
bool result = DWKitRuntime.Security.CheckPermission("Group Name", "Permission Name").Result;
bool result = DWKitRuntime.Security.CheckFormPermission("Form Name", "Permission Name").Result;
  • a method of user authentication
bool result = DWKitRuntime.Security.ValidateUserByLoginAsync("User's login","password").Result;
bool remember;
DWKitRuntime.Security.SignIn("User's login", remember).Wait();
  • a method of signing out
DWKitRuntime.Security.SignOut().Wait();

To interact with the client, the security subsystem uses AccountController that calls the Security Provider methods.