Skip to main content

UserAuthRepositoryExtensions

Assembly: ServiceStack.dll​
View Source​
Declaration
public static class UserAuthRepositoryExtensions

Methods​

AssignRoles(IAuthRepository, IUserAuth, ICollection<String>, ICollection<String>)​

Creates the required missing tables or DB schema

View Source​
Declaration
public static void AssignRoles(this IAuthRepository userAuthRepo, IUserAuth userAuth, ICollection<string> roles = null, ICollection<string> permissions = null)
Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryuserAuthRepo
ServiceStack.Auth.IUserAuthuserAuth
System.Collections.Generic.ICollection<System.String>roles
System.Collections.Generic.ICollection<System.String>permissions

AssignRolesAsync(IAuthRepositoryAsync, IUserAuth, ICollection<String>, ICollection<String>, CancellationToken)​

Creates the required missing tables or DB schema

View Source​
Declaration
public static async Task AssignRolesAsync(this IAuthRepositoryAsync userAuthRepo, IUserAuth userAuth, ICollection<string> roles = null, ICollection<string> permissions = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncuserAuthRepo
ServiceStack.Auth.IUserAuthuserAuth
System.Collections.Generic.ICollection<System.String>roles
System.Collections.Generic.ICollection<System.String>permissions
System.Threading.CancellationTokentoken

UnAssignRoles(IAuthRepository, IUserAuth, ICollection<String>, ICollection<String>)​

View Source​
Declaration
public static void UnAssignRoles(this IAuthRepository userAuthRepo, IUserAuth userAuth, ICollection<string> roles = null, ICollection<string> permissions = null)
Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryuserAuthRepo
ServiceStack.Auth.IUserAuthuserAuth
System.Collections.Generic.ICollection<System.String>roles
System.Collections.Generic.ICollection<System.String>permissions

UnAssignRolesAsync(IAuthRepositoryAsync, IUserAuth, ICollection<String>, ICollection<String>, CancellationToken)​

View Source​
Declaration
public static async Task UnAssignRolesAsync(this IAuthRepositoryAsync userAuthRepo, IUserAuth userAuth, ICollection<string> roles = null, ICollection<string> permissions = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncuserAuthRepo
ServiceStack.Auth.IUserAuthuserAuth
System.Collections.Generic.ICollection<System.String>roles
System.Collections.Generic.ICollection<System.String>permissions
System.Threading.CancellationTokentoken

GetRoles(IAuthRepository, IUserAuth)​

View Source​
Declaration
public static ICollection<string> GetRoles(this IAuthRepository userAuthRepo, IUserAuth userAuth)
Returns​

System.Collections.Generic.ICollection<System.String>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryuserAuthRepo
ServiceStack.Auth.IUserAuthuserAuth

GetRolesAsync(IAuthRepositoryAsync, IUserAuth, CancellationToken)​

View Source​
Declaration
public static async Task<ICollection<string>> GetRolesAsync(this IAuthRepositoryAsync userAuthRepo, IUserAuth userAuth, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.ICollection<System.String>>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncuserAuthRepo
ServiceStack.Auth.IUserAuthuserAuth
System.Threading.CancellationTokentoken

GetPermissions(IAuthRepository, IUserAuth)​

View Source​
Declaration
public static ICollection<string> GetPermissions(this IAuthRepository userAuthRepo, IUserAuth userAuth)
Returns​

System.Collections.Generic.ICollection<System.String>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryuserAuthRepo
ServiceStack.Auth.IUserAuthuserAuth

GetPermissionsAsync(IAuthRepositoryAsync, IUserAuth, CancellationToken)​

View Source​
Declaration
public static async Task<ICollection<string>> GetPermissionsAsync(this IAuthRepositoryAsync userAuthRepo, IUserAuth userAuth, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.ICollection<System.String>>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncuserAuthRepo
ServiceStack.Auth.IUserAuthuserAuth
System.Threading.CancellationTokentoken

GetAuthTokens(IAuthRepository, String)​

View Source​
Declaration
public static List<IAuthTokens> GetAuthTokens(this IAuthRepository repo, string userAuthId)
Returns​

System.Collections.Generic.List<ServiceStack.Auth.IAuthTokens>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryrepo
System.StringuserAuthId

GetAuthTokensAsync(IAuthRepositoryAsync, String, CancellationToken)​

View Source​
Declaration
public static async Task<List<IAuthTokens>> GetAuthTokensAsync(this IAuthRepositoryAsync repo, string userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.Auth.IAuthTokens>>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncrepo
System.StringuserAuthId
System.Threading.CancellationTokentoken

PopulateSession(IAuthSession, IUserAuth, IAuthRepository)​

View Source​
Declaration
public static void PopulateSession(this IAuthSession session, IUserAuth userAuth, IAuthRepository authRepo = null)
Parameters​
TypeName
ServiceStack.Auth.IAuthSessionsession
ServiceStack.Auth.IUserAuthuserAuth
ServiceStack.Auth.IAuthRepositoryauthRepo

PopulateSessionAsync(IAuthSession, IUserAuth, IAuthRepositoryAsync, CancellationToken)​

View Source​
Declaration
public static async Task PopulateSessionAsync(this IAuthSession session, IUserAuth userAuth, IAuthRepositoryAsync authRepo = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Auth.IAuthSessionsession
ServiceStack.Auth.IUserAuthuserAuth
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.Threading.CancellationTokentoken

GetUserAuthDetails(IAuthRepository, Int32)​

View Source​
Declaration
public static List<IUserAuthDetails> GetUserAuthDetails(this IAuthRepository authRepo, int userAuthId)
Returns​

System.Collections.Generic.List<ServiceStack.Auth.IUserAuthDetails>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo
System.Int32userAuthId

GetUserAuthDetailsAsync(IAuthRepositoryAsync, Int32, CancellationToken)​

View Source​
Declaration
public static Task<List<IUserAuthDetails>> GetUserAuthDetailsAsync(this IAuthRepositoryAsync authRepo, int userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.Auth.IUserAuthDetails>>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.Int32userAuthId
System.Threading.CancellationTokentoken

GetUserAuth(IUserAuthRepository, Int32)​

View Source​
Declaration
public static IUserAuth GetUserAuth(this IUserAuthRepository authRepo, int userAuthId)
Returns​

ServiceStack.Auth.IUserAuth

Parameters​
TypeName
ServiceStack.Auth.IUserAuthRepositoryauthRepo
System.Int32userAuthId

GetUserAuthAsync(IUserAuthRepositoryAsync, Int32, CancellationToken)​

View Source​
Declaration
public static Task<IUserAuth> GetUserAuthAsync(this IUserAuthRepositoryAsync authRepo, int userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<ServiceStack.Auth.IUserAuth>

Parameters​
TypeName
ServiceStack.Auth.IUserAuthRepositoryAsyncauthRepo
System.Int32userAuthId
System.Threading.CancellationTokentoken

DeleteUserAuth(IUserAuthRepository, Int32)​

View Source​
Declaration
public static void DeleteUserAuth(this IUserAuthRepository authRepo, int userAuthId)
Parameters​
TypeName
ServiceStack.Auth.IUserAuthRepositoryauthRepo
System.Int32userAuthId

DeleteUserAuthAsync(IUserAuthRepositoryAsync, Int32, CancellationToken)​

View Source​
Declaration
public static Task DeleteUserAuthAsync(this IUserAuthRepositoryAsync authRepo, int userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Auth.IUserAuthRepositoryAsyncauthRepo
System.Int32userAuthId
System.Threading.CancellationTokentoken

GetRoles(IManageRoles, Int32)​

View Source​
Declaration
public static ICollection<string> GetRoles(this IManageRoles manageRoles, int userAuthId)
Returns​

System.Collections.Generic.ICollection<System.String>

Parameters​
TypeName
ServiceStack.Auth.IManageRolesmanageRoles
System.Int32userAuthId

GetRolesAsync(IManageRolesAsync, Int32, CancellationToken)​

View Source​
Declaration
public static Task<ICollection<string>> GetRolesAsync(this IManageRolesAsync manageRoles, int userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.ICollection<System.String>>

Parameters​
TypeName
ServiceStack.Auth.IManageRolesAsyncmanageRoles
System.Int32userAuthId
System.Threading.CancellationTokentoken

GetPermissions(IManageRoles, Int32)​

View Source​
Declaration
public static ICollection<string> GetPermissions(this IManageRoles manageRoles, int userAuthId)
Returns​

System.Collections.Generic.ICollection<System.String>

Parameters​
TypeName
ServiceStack.Auth.IManageRolesmanageRoles
System.Int32userAuthId

GetPermissionsAsync(IManageRolesAsync, Int32, CancellationToken)​

View Source​
Declaration
public static Task<ICollection<string>> GetPermissionsAsync(this IManageRolesAsync manageRoles, int userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.ICollection<System.String>>

Parameters​
TypeName
ServiceStack.Auth.IManageRolesAsyncmanageRoles
System.Int32userAuthId
System.Threading.CancellationTokentoken

HasRole(IManageRoles, Int32, String)​

View Source​
Declaration
public static bool HasRole(this IManageRoles manageRoles, int userAuthId, string role)
Returns​

System.Boolean

Parameters​
TypeName
ServiceStack.Auth.IManageRolesmanageRoles
System.Int32userAuthId
System.Stringrole

HasRoleAsync(IManageRolesAsync, Int32, String, CancellationToken)​

View Source​
Declaration
public static Task<bool> HasRoleAsync(this IManageRolesAsync manageRoles, int userAuthId, string role, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Boolean>

Parameters​
TypeName
ServiceStack.Auth.IManageRolesAsyncmanageRoles
System.Int32userAuthId
System.Stringrole
System.Threading.CancellationTokentoken

HasPermission(IManageRoles, Int32, String)​

View Source​
Declaration
public static bool HasPermission(this IManageRoles manageRoles, int userAuthId, string permission)
Returns​

System.Boolean

Parameters​
TypeName
ServiceStack.Auth.IManageRolesmanageRoles
System.Int32userAuthId
System.Stringpermission

HasPermissionAsync(IManageRolesAsync, Int32, String, CancellationToken)​

View Source​
Declaration
public static Task<bool> HasPermissionAsync(this IManageRolesAsync manageRoles, int userAuthId, string permission, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Boolean>

Parameters​
TypeName
ServiceStack.Auth.IManageRolesAsyncmanageRoles
System.Int32userAuthId
System.Stringpermission
System.Threading.CancellationTokentoken

AssignRoles(IManageRoles, Int32, ICollection<String>, ICollection<String>)​

View Source​
Declaration
public static void AssignRoles(this IManageRoles manageRoles, int userAuthId, ICollection<string> roles = null, ICollection<string> permissions = null)
Parameters​
TypeName
ServiceStack.Auth.IManageRolesmanageRoles
System.Int32userAuthId
System.Collections.Generic.ICollection<System.String>roles
System.Collections.Generic.ICollection<System.String>permissions

AssignRolesAsync(IManageRolesAsync, Int32, ICollection<String>, ICollection<String>, CancellationToken)​

View Source​
Declaration
public static Task AssignRolesAsync(this IManageRolesAsync manageRoles, int userAuthId, ICollection<string> roles = null, ICollection<string> permissions = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Auth.IManageRolesAsyncmanageRoles
System.Int32userAuthId
System.Collections.Generic.ICollection<System.String>roles
System.Collections.Generic.ICollection<System.String>permissions
System.Threading.CancellationTokentoken

UnAssignRoles(IManageRoles, Int32, ICollection<String>, ICollection<String>)​

View Source​
Declaration
public static void UnAssignRoles(this IManageRoles manageRoles, int userAuthId, ICollection<string> roles = null, ICollection<string> permissions = null)
Parameters​
TypeName
ServiceStack.Auth.IManageRolesmanageRoles
System.Int32userAuthId
System.Collections.Generic.ICollection<System.String>roles
System.Collections.Generic.ICollection<System.String>permissions

UnAssignRolesAsync(IManageRolesAsync, Int32, ICollection<String>, ICollection<String>, CancellationToken)​

View Source​
Declaration
public static Task UnAssignRolesAsync(this IManageRolesAsync manageRoles, int userAuthId, ICollection<string> roles = null, ICollection<string> permissions = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Auth.IManageRolesAsyncmanageRoles
System.Int32userAuthId
System.Collections.Generic.ICollection<System.String>roles
System.Collections.Generic.ICollection<System.String>permissions
System.Threading.CancellationTokentoken

CreateUserAuth(IAuthRepository, IUserAuth, String)​

View Source​
Declaration
public static IUserAuth CreateUserAuth(this IAuthRepository authRepo, IUserAuth newUser, string password)
Returns​

ServiceStack.Auth.IUserAuth

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword

CreateUserAuthAsync(IAuthRepositoryAsync, IUserAuth, String, CancellationToken)​

View Source​
Declaration
public static Task<IUserAuth> CreateUserAuthAsync(this IAuthRepositoryAsync authRepo, IUserAuth newUser, string password, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<ServiceStack.Auth.IUserAuth>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword
System.Threading.CancellationTokentoken

UpdateUserAuth(IAuthRepository, IUserAuth, IUserAuth)​

View Source​
Declaration
public static IUserAuth UpdateUserAuth(this IAuthRepository authRepo, IUserAuth existingUser, IUserAuth newUser)
Returns​

ServiceStack.Auth.IUserAuth

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo
ServiceStack.Auth.IUserAuthexistingUser
ServiceStack.Auth.IUserAuthnewUser

UpdateUserAuthAsync(IAuthRepositoryAsync, IUserAuth, IUserAuth, CancellationToken)​

View Source​
Declaration
public static Task<IUserAuth> UpdateUserAuthAsync(this IAuthRepositoryAsync authRepo, IUserAuth existingUser, IUserAuth newUser, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<ServiceStack.Auth.IUserAuth>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
ServiceStack.Auth.IUserAuthexistingUser
ServiceStack.Auth.IUserAuthnewUser
System.Threading.CancellationTokentoken

UpdateUserAuth(IAuthRepository, IUserAuth, IUserAuth, String)​

View Source​
Declaration
public static IUserAuth UpdateUserAuth(this IAuthRepository authRepo, IUserAuth existingUser, IUserAuth newUser, string password)
Returns​

ServiceStack.Auth.IUserAuth

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo
ServiceStack.Auth.IUserAuthexistingUser
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword

UpdateUserAuthAsync(IAuthRepositoryAsync, IUserAuth, IUserAuth, String, CancellationToken)​

View Source​
Declaration
public static Task<IUserAuth> UpdateUserAuthAsync(this IAuthRepositoryAsync authRepo, IUserAuth existingUser, IUserAuth newUser, string password, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<ServiceStack.Auth.IUserAuth>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
ServiceStack.Auth.IUserAuthexistingUser
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword
System.Threading.CancellationTokentoken

GetUserAuth(IAuthRepository, String)​

View Source​
Declaration
public static IUserAuth GetUserAuth(this IAuthRepository authRepo, string userAuthId)
Returns​

ServiceStack.Auth.IUserAuth

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo
System.StringuserAuthId

GetUserAuthAsync(IAuthRepositoryAsync, String, CancellationToken)​

View Source​
Declaration
public static Task<IUserAuth> GetUserAuthAsync(this IAuthRepositoryAsync authRepo, string userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<ServiceStack.Auth.IUserAuth>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.StringuserAuthId
System.Threading.CancellationTokentoken

DeleteUserAuth(IAuthRepository, String)​

View Source​
Declaration
public static void DeleteUserAuth(this IAuthRepository authRepo, string userAuthId)
Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo
System.StringuserAuthId

DeleteUserAuthAsync(IAuthRepositoryAsync, String, CancellationToken)​

View Source​
Declaration
public static Task DeleteUserAuthAsync(this IAuthRepositoryAsync authRepo, string userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.StringuserAuthId
System.Threading.CancellationTokentoken

GetUserAuths(IAuthRepository, String, Nullable<Int32>, Nullable<Int32>)​

View Source​
Declaration
public static List<IUserAuth> GetUserAuths(this IAuthRepository authRepo, string orderBy = null, int? skip = null, int? take = null)
Returns​

System.Collections.Generic.List<ServiceStack.Auth.IUserAuth>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo
System.StringorderBy
System.Nullable<System.Int32>skip
System.Nullable<System.Int32>take

GetUserAuthsAsync(IAuthRepositoryAsync, String, Nullable<Int32>, Nullable<Int32>, CancellationToken)​

View Source​
Declaration
public static Task<List<IUserAuth>> GetUserAuthsAsync(this IAuthRepositoryAsync authRepo, string orderBy = null, int? skip = null, int? take = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.Auth.IUserAuth>>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.StringorderBy
System.Nullable<System.Int32>skip
System.Nullable<System.Int32>take
System.Threading.CancellationTokentoken

SearchUserAuths(IAuthRepository, String, String, Nullable<Int32>, Nullable<Int32>)​

View Source​
Declaration
public static List<IUserAuth> SearchUserAuths(this IAuthRepository authRepo, string query, string orderBy = null, int? skip = null, int? take = null)
Returns​

System.Collections.Generic.List<ServiceStack.Auth.IUserAuth>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo
System.Stringquery
System.StringorderBy
System.Nullable<System.Int32>skip
System.Nullable<System.Int32>take

SearchUserAuthsAsync(IAuthRepositoryAsync, String, String, Nullable<Int32>, Nullable<Int32>, CancellationToken)​

View Source​
Declaration
public static Task<List<IUserAuth>> SearchUserAuthsAsync(this IAuthRepositoryAsync authRepo, string query, string orderBy = null, int? skip = null, int? take = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.Auth.IUserAuth>>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.Stringquery
System.StringorderBy
System.Nullable<System.Int32>skip
System.Nullable<System.Int32>take
System.Threading.CancellationTokentoken

MergeRolesAsync(IAuthRepositoryAsync, String, String, ICollection<String>, CancellationToken)​

View Source​
Declaration
public static async Task MergeRolesAsync(this IAuthRepositoryAsync authRepo, string userAuthId, string source, ICollection<string> roles, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.StringuserAuthId
System.Stringsource
System.Collections.Generic.ICollection<System.String>roles
System.Threading.CancellationTokentoken

GetLocalRolesAndPermissionsAsync(IManageRolesAsync, String, CancellationToken)​

View Source​
Declaration
public static Task<Tuple<ICollection<string>, ICollection<string>>> GetLocalRolesAndPermissionsAsync(this IManageRolesAsync manageRoles, string userAuthId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Tuple<System.Collections.Generic.ICollection<System.String>,System.Collections.Generic.ICollection<System.String>>>

Parameters​
TypeName
ServiceStack.Auth.IManageRolesAsyncmanageRoles
System.StringuserAuthId
System.Threading.CancellationTokentoken

ValidateNewUser(IUserAuth)​

View Source​
Declaration
public static void ValidateNewUser(this IUserAuth newUser)
Parameters​
TypeName
ServiceStack.Auth.IUserAuthnewUser

ValidateNewUser(IUserAuth, String)​

View Source​
Declaration
public static void ValidateNewUser(this IUserAuth newUser, string password)
Parameters​
TypeName
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword