UserModel user = new UserModel(); user.UserName = "johndoe"; user.Password = "password"; user.Email = "[email protected]"; user.FullName = "John Doe"; user.RoleIds = new List{ 1, 2 }; // role IDs that the user belongs to int userId = user.Create();
UserModel user = new UserModel(); bool isAuthenticated = user.Authenticate("johndoe", "password"); if (isAuthenticated) { // the user is authenticated } else { // authentication failed }
UserModel user = new UserModel(); bool hasPermission = user.HasPermission(1, "manage_users"); if (hasPermission) { // the user has permission to manage users } else { // the user does not have permission }In these examples, the NFMT.Common UserModel package library is used to create, authenticate, and check permissions for user accounts.