UserManagement
TsgcHTMLComponent_UserManagement — a user administration table with avatar, roles, status, search and a per-row actions dropdown, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_UserManagement — a user administration table with avatar, roles, status, search and a per-row actions dropdown, in Delphi, C++ Builder and .NET.
Add users with AddUser (or bind a dataset), pick which columns and row actions to expose, then read the HTML property.
TsgcHTMLComponent_UserManagement
Toolbar + Bootstrap 5 table + actions dropdown
Delphi, C++ Builder, .NET
Call AddUser for each account, read HTML for the table, then authorize and apply any action received over the WebSocket channel with ProcessUserAction.
uses
sgcHTML_Component_UserManagement;
var
oUsers: TsgcHTMLComponent_UserManagement;
oUser: TsgcHTMLUser;
begin
oUsers := TsgcHTMLComponent_UserManagement.Create(nil);
try
oUsers.TableID := 'users';
oUsers.AllowImpersonate := True;
oUsers.AllowDelete := True;
oUser := oUsers.AddUser('u1', 'ana.torres', 'ana@example.com');
oUser.DisplayName := 'Ana Torres';
oUser.Roles := 'admin,editor';
oUser.Status := usActive;
oUser.LastLogin := '2026-07-15 09:12';
oUsers.AddUser('u2', 'marc.bell', 'marc@example.com').Status := usInvited;
WebModule.Response := oUsers.HTML; // toolbar + table + inline script
finally
oUsers.Free;
end;
end;
// Server-side handler for an action received over WebSockets.
// ALWAYS verify the acting user is authorized before applying it:
oUsers.ProcessUserAction('userDisable', 'u2');
// includes: sgcHTML_Component_UserManagement.hpp
TsgcHTMLComponent_UserManagement *oUsers = new TsgcHTMLComponent_UserManagement(NULL);
try
{
oUsers->TableID = "users";
oUsers->AllowImpersonate = true;
oUsers->AllowDelete = true;
TsgcHTMLUser *oUser = oUsers->AddUser("u1", "ana.torres", "ana@example.com");
oUser->DisplayName = "Ana Torres";
oUser->Roles = "admin,editor";
oUser->Status = usActive;
oUser->LastLogin = "2026-07-15 09:12";
oUsers->AddUser("u2", "marc.bell", "marc@example.com")->Status = usInvited;
String html = oUsers->HTML; // toolbar + table + inline script
// Server-side handler for an action received over WebSockets:
oUsers->ProcessUserAction("userDisable", "u2");
}
__finally
{
delete oUsers;
}
using esegece.sgcWebSockets;
var users = new TsgcHTMLComponent_UserManagement();
users.TableID = "users";
users.AllowImpersonate = true;
users.AllowDelete = true;
var user = users.AddUser("u1", "ana.torres", "ana@example.com");
user.DisplayName = "Ana Torres";
user.Roles = "admin,editor";
user.Status = TsgcHTMLUserStatus.usActive;
user.LastLogin = "2026-07-15 09:12";
users.AddUser("u2", "marc.bell", "marc@example.com").Status = TsgcHTMLUserStatus.usInvited;
string html = users.HTML; // toolbar + table + inline script
// Server-side handler for an action received over WebSockets.
// ALWAYS verify the acting user is authorized before applying it:
users.ProcessUserAction("userDisable", "u2");
The members you reach for most often.
AddUser(aId, aUserName, aEmail) appends a row and returns the TsgcHTMLUser so you can set DisplayName, Roles, Status, LastLogin and AvatarURL.
LoadFromDataSet(aDataSet, aIdField, aUserNameField, aEmailField, aRolesField, aStatusField) populates the table and remembers the mapping for later refreshes.
TsgcHTMLUserStatus — usActive, usInvited, usSuspended, usDisabled — renders as a colour badge; Roles is a comma-separated list rendered as badges.
Every row's dropdown offers Edit / Disable-Enable / Reset password; AllowImpersonate and AllowDelete add the more sensitive actions.
ShowSearch, ShowAddButton (with AddCaption / SearchPlaceholder) control the toolbar; ShowRoles, ShowStatus, ShowLastLogin, ShowActions and PageSize control the table.
Every action travels client-to-server as JSON (and fires sgcUserManagement:action). ProcessUserAction must only run after the host verifies the acting user is authorized for that action.
| Online HelpFull API reference and usage guide for this component. | Open | |
| All sgcHTML ComponentsBrowse the full feature matrix of 80+ components. | Open | |
| Download Free TrialThe 30-day trial ships the 60.HTML demo projects. | Open | |
| PricingSingle, Team and Site licenses with full source code. | Open |