Nucleus .Net Core CMS

Managers.IUserManager Interface

Namespace: Nucleus.Abstractions.Managers
Assembly: Nucleus.Abstractions.dll
Provides functions to manage database data for Models.Users.

Remarks

Get an instance of this class from dependency injection by including a parameter in your class constructor.

Methods

ValidatePasswordComplexity (String,String) Method

ValidatePasswordComplexity (String key, String password)
Check that the specified password is valid.
Parameters
Name Type
key String

The key for model state errors. This is generally the name of the model property being validated.

password String
Remarks
Each Models.Configuration.PasswordComplexityRule is executed, and the results are returned in a ModelStateDictionary.

VerifyPassword (User,String) Method

VerifyPassword (User user, String password)
Verify that the user's password is correct
Parameters
Name Type
user Nucleus.Abstractions.Models.User
password String
Remarks
This function also manages failed login tracking, account suspension

SetPasswordResetToken (User) Method

SetPasswordResetToken (User user)
Generate and set a random password reset token.
Parameters
Name Type
user Nucleus.Abstractions.Models.User

UnlockUser (User) Method

UnlockUser (User user)
Unlock the specified user's account
Parameters
Name Type
user Nucleus.Abstractions.Models.User

SetPassword (User,String) Method

SetPassword (User user, String newPassword)
Set a new password for the specified user.
Parameters
Name Type
user Nucleus.Abstractions.Models.User
newPassword String
Remarks
This function saves the new password to the database.

SetVerificationToken (User) Method

SetVerificationToken (User user)
Generate and set a random verification token.
Parameters
Name Type
user Nucleus.Abstractions.Models.User

CreateNew (Site) Method

CreateNew (Nucleus.Abstractions.Models.Site)
Create a new Models.User with default values.
Remarks
This function does not save the new Models.User to the database. Call Save to save the role group.

Get (Site,Guid) Method

Get (Site site, Guid id)
Retrieve an existing Models.User from the database.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
id Guid

Get (Guid) Method

Get (Guid id)
Retrieve an existing Models.User from the database.
Parameters
Name Type
id Guid

Get (Site,String) Method

Get (Site site, String userName)
Retrieve an existing Models.User from the database, matching by the specified userName.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
userName String

GetByEmail (Site,String) Method

GetByEmail (Site site, String email)
Retrieve an existing Models.User from the database, matching by the specified email address.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
email String

GetSystemAdministrator (String) Method

GetSystemAdministrator (String userName)
Retrieve an existing System Administrator Models.User from the database, matching by the specified userName.
Parameters
Name Type
userName String

AddRole (User,Guid) Method

AddRole (User user, Guid roleId)
Add the specified Models.Role to the specified Models.User.
Parameters
Name Type
user Nucleus.Abstractions.Models.User
roleId Guid
Remarks
Changes are not saved to the database. Call the Save method to save changes.

RemoveRole (User,Guid) Method

RemoveRole (User user, Guid roleId)
Removes the specified Models.Role to the specified Models.User.
Parameters
Name Type
user Nucleus.Abstractions.Models.User
roleId Guid
Remarks
Changes are not saved to the database. Call the Save method to save changes.

List (Site) Method

List (Site site)
List all Models.Users who belong to the specified Models.Site.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site

List (Site,PagingSettings) Method

List (Site site, PagingSettings pagingSettings)
List a page of Models.Users who belong to the specified Models.Site.

List (Site,PagingSettings,User) Method

List (Site site, PagingSettings pagingSettings, User filterExpression)
List a page of Models.Users who belong to the specified Models.Site.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
pagingSettings Nucleus.Abstractions.Models.Paging.PagingSettings
filterExpression System.Linq.Expressions.Expression<System.Func<Nucleus.Abstractions.Models.User

ListSystemAdministrators (PagingSettings) Method

ListSystemAdministrators (Nucleus.Abstractions.Models.Paging.PagingSettings)
List all System Administrator Models.Users.

CountSystemAdministrators

CountSystemAdministrators ()
Count the number of System Administrator Models.Users.

Search (Site,String,PagingSettings) Method

Search (Site site, String searchTerm, PagingSettings pagingSettings)
Returns a list of Models.Users whi match the specified searchTerm.

Search (Site,String,PagingSettings,User) Method

Search (Site site, String searchTerm, PagingSettings pagingSettings, User filterExpression)
Returns a list of Models.Users whi match the specified searchTerm.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
searchTerm String
pagingSettings Nucleus.Abstractions.Models.Paging.PagingSettings
filterExpression System.Linq.Expressions.Expression<System.Func<Nucleus.Abstractions.Models.User

Save (Site,User) Method

Save (Site site, User user)
Create or update the specified Models.User.

SetNewUserFlags (Site,User) Method

SetNewUserFlags (Site site, User user)
Set Models.User approved and verified flags based on site settings.
Remarks
This function is called by CreateNew, so it doesn't need to be called unless the user is being created without a call to CreateNew().

SaveSecrets (User) Method

SaveSecrets (User user)
Save user secrets.
Parameters
Name Type
user Nucleus.Abstractions.Models.User

SaveSystemAdministrator (User) Method

SaveSystemAdministrator (User user)
Create or update the specified System Administrator Models.User.
Parameters
Name Type
user Nucleus.Abstractions.Models.User

Delete (User) Method

Delete (User user)
Delete the specified Models.User from the database.
Parameters
Name Type
user Nucleus.Abstractions.Models.User

ListUsersInRole (Role) Method

ListUsersInRole (Role role)
List the Models.Users who are members of the specified Models.Role.
Parameters
Name Type
role Nucleus.Abstractions.Models.Role

ListUsersInRole (Role,PagingSettings) Method

ListUsersInRole (Role role, PagingSettings pagingSettings)
List the Models.Users who are members of the specified Models.Role with paging.