extend solution access dynamically during runtime, allowing user management without modifying the solution configuration. RuntimeUsers provide:
RuntimeUsers combined with SecurityUsers form the complete Solution Users.
Aspect | SecurityUsers | RuntimeUsers |
---|---|---|
Creation | Design-time only | Runtime only |
Storage | Solution file | External database |
Engineering Access | Yes | No |
Modify Solution | Yes | No |
Runtime Access | Yes | Yes |
Source | Internal | External/Scripts |
<ac:structured-macro ac:name="note"> ac:rich-text-body RuntimeUsers cannot access Engineering mode or modify solution configuration. They are application users only. </ac:rich-text-body> </ac:structured-macro>
csharp
// Create user programmatically
@Security.CreateUser(
"john.doe",
"password123",
"Operator,Maintenance",
"Enhanced"
);
Configure at Datasets → DBs → RuntimeUsers
Access read-only view at Security → RuntimeUsers:
Property | Description | Modifiable |
---|---|---|
Name | Unique username | Via script/DB |
Password | Encrypted credential | Via script/DB |
Permissions | Group assignments | Via script/DB |
Policy | Security policy | Via script/DB |
Blocked | Access denied flag | Via script/DB |
Deleted | Soft delete marker | Via script/DB |
InvalidAttempts | Failed login count | Auto-updated |
ChangePasswordRequired | Force password change | Via script/DB |
LastChangePasswordUTC_Ticks | Password change timestamp | Auto-updated |
LastBlockedUserUTC_Ticks | Block timestamp | Auto-updated |
Level | Hierarchical access | Via script/DB |
Category | User classification | Via script/DB |
ContactInfo | Email/phone | Via script/DB |
Company | Organization | Via script/DB |
UserGroup | Department | Via script/DB |
Location: <SolutionPath>.dbRuntimeUsers
Table automatically created with:
csharp
public void CreateOperator(string username, string password)
{
bool success = @Security.CreateUser(
username,
password,
"Operator", // Permissions
"Default" // Policy
);
if (success)
{
@Info.Trace($"User {username} created");
}
}
csharp
// Change password
@Security.ChangePassword("john.doe", "newPassword");
// Update permissions
@Security.SetUserPermissions("john.doe", "Operator,Supervisor");
// Block user
@Security.BlockUser("john.doe");
csharp
// Soft delete (mark as deleted)
@Security.DeleteUser("john.doe", softDelete: true);
// Hard delete (remove from database)
@Security.DeleteUser("john.doe", softDelete: false);
csharp
// Enable AD authentication
@Security.AuthenticationMode = "WindowsAD";
@Security.ADDomain = "company.local";
// Map AD groups to permissions
@Security.ADGroupMapping["Domain Users"] = "Operator";
@Security.ADGroupMapping["Domain Admins"] = "Administrator";
csharp
// Get all active users
var users = @Security.GetActiveUsers();
// Check if RuntimeUser
bool isRuntimeUser = @Security.IsRuntimeUser(username);
// Get user source
string source = @Security.GetUserSource(username);
// Returns: "Internal", "Database", "AD"
User not found:
Cannot create user:
AD users not working:
Database errors: