-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathUser.cs
More file actions
31 lines (27 loc) · 811 Bytes
/
User.cs
File metadata and controls
31 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using Waher.Security;
namespace Waher.Networking.CoAP.Test
{
internal class User : IUser
{
private readonly string[] privileges;
private readonly string userName;
private readonly string passwordHash;
private readonly string passwordHashType;
public User(string UserName, string PasswordHash, string PasswordHashType,
params string[] Privileges)
{
this.userName = UserName;
this.passwordHash = PasswordHash;
this.passwordHashType = PasswordHashType;
this.privileges = Privileges;
}
public string UserName => this.userName;
public string PasswordHash => this.passwordHash;
public string PasswordHashType => this.passwordHashType;
public bool HasPrivilege(string Privilege)
{
return Array.IndexOf<string>(this.privileges, Privilege) >= 0;
}
}
}