Class UserManager
Stellt Funktionen bereit, um mit Simplic-Usern zu arbeiten
Inheritance
Inherited Members
Namespace: Simplic.Framework.Base
Assembly: Simplic.Framework.Base.dll
Syntax
public class UserManager
Properties
| Improve this Doc View SourceSingleton
Declaration
public static UserManager Singleton { get; }
Property Value
Type | Description |
---|---|
UserManager |
Methods
| Improve this Doc View SourceDeleteExternAccount(Guid)
Delete an extern account
Declaration
public void DeleteExternAccount(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Account id |
GenerateApiKey(Int32)
Generate a new api key
Declaration
public string GenerateApiKey(int userId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | Unique user id |
Returns
Type | Description |
---|---|
System.String | Generated api key |
GetAccountTypes()
Get all types of external accounts
Declaration
public IList<ExternAccountType> GetAccountTypes()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<ExternAccountType> | List of external account types |
GetApiKey(Int32)
Get API key for the current user
Declaration
public string GetApiKey(int userId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | Unique user id |
Returns
Type | Description |
---|---|
System.String | Api key |
GetApiUser(String, String)
Get user id by apikey and username
Declaration
public int? GetApiUser(string apiKey, string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | apiKey | api key |
System.String | userName | User name |
Returns
Type | Description |
---|---|
System.Nullable<System.Int32> | Api key / user name |
GetEmailAddress(Int64)
Gets the email address of the given user id
Declaration
public string GetEmailAddress(long userId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | userId | UserId to get the email address from |
Returns
Type | Description |
---|---|
System.String | Email address |
GetEmailAddressesByGroupId(Int64)
Gets all the email addresses belonging to the given group ID
Declaration
public IList<string> GetEmailAddressesByGroupId(long groupId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | groupId | A Group ID to get all the users belonging to that group. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.String> | A list of email addresses belonging to a group of users. |
GetExternAccount(Guid)
Get an extern account by its id Here we need some security improvement.
Declaration
public ExternAccount GetExternAccount(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique account id |
Returns
Type | Description |
---|---|
ExternAccount | Instance of an extern account |
GetExternAccount(Int32, Guid)
Get extern account by user id and type
Declaration
public ExternAccount GetExternAccount(int userId, Guid typeId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | Simplic user id |
System.Guid | typeId | Account type |
Returns
Type | Description |
---|---|
ExternAccount | Account instance if exists |
GetFriendlyName(Int32)
Gibt den Anzeigenamen eines Benutzers zurück
Declaration
public string GetFriendlyName(int UserId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | UserId | BenutzerId |
Returns
Type | Description |
---|---|
System.String | Name als String |
GetIdByName(String)
Get user ID from the username
Declaration
public int GetIdByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the user |
Returns
Type | Description |
---|---|
System.Int32 | Api key |
GetUserIdByExternAccount(String, Guid, out Int32)
Get the simplic user id by an external account name
Declaration
public bool GetUserIdByExternAccount(string userName, Guid accountType, out int userId)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | External account name |
System.Guid | accountType | Account type |
System.Int32 | userId | Simplic userid |
Returns
Type | Description |
---|---|
System.Boolean | True when a sigle, active user was found |
RefreshSubstitution(Int32)
Refresh user substitution
Declaration
public void RefreshSubstitution(int userId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId |
SetExternAccount(ExternAccount)
Set extern account data Here we need some security improvement.
Declaration
public void SetExternAccount(ExternAccount account)
Parameters
Type | Name | Description |
---|---|---|
ExternAccount | account | Account instance |
UpdateActiveSubstitutions(SAConnection)
Update active substitution flags.
Declaration
public void UpdateActiveSubstitutions(SAConnection connection)
Parameters
Type | Name | Description |
---|---|---|
Sap.Data.SQLAnywhere.SAConnection | connection |