master
Harald Wolff 2019-11-18 08:56:11 +01:00
parent 52588d66d5
commit 897a774e77
4 changed files with 42 additions and 4 deletions

View File

@ -54,7 +54,8 @@ namespace ln.identities
public void AddSecureAttribute(SecureAttribute secureAttribute) => secureAttributes.Add(secureAttribute);
public void RemoveSecureAttribute(SecureAttribute secureAttribute) => secureAttributes.Remove(secureAttribute);
public override bool Equals(object obj) => (obj is Identity other) && other.UniqueID.Equals(UniqueID);
public override int GetHashCode() => UniqueID.GetHashCode();
}
}

18
Role.cs
View File

@ -3,11 +3,25 @@ namespace ln.identities
{
public class Role
{
public String Name { get; }
public static readonly Role SuperUser = new Role(Guid.Parse("{eefca5e2-2295-44d5-9b24-000000000000}"),"SuperUser");
public static readonly Role Owner = new Role(Guid.Parse("{eefca5e2-2295-44d5-9b24-000000000001}"), "Owner");
public static readonly Role Editor = new Role(Guid.Parse("{eefca5e2-2295-44d5-9b24-000000000002}"), "Editor");
public Guid UniqueID { get; }
public String Name { get; set; }
public Role()
private Role()
{}
public Role(string roleName):this(Guid.NewGuid(),roleName){}
public Role(Guid uniqueID,string roleName)
{
UniqueID = uniqueID;
Name = roleName;
}
public override bool Equals(object obj) => (obj is Role other) && other.UniqueID.Equals(UniqueID);
public override int GetHashCode() => UniqueID.GetHashCode();
}
}

View File

@ -3,7 +3,10 @@ namespace ln.identities
{
public class RoleAssignment
{
public RoleAssignment()
public Identity EffectiveIdentity { get; }
public Role Role { get; }
private RoleAssignment()
{
}
}

20
Roles.cs 100644
View File

@ -0,0 +1,20 @@
// /**
// * File: Roles.cs
// * Author: haraldwolff
// *
// * This file and it's content is copyrighted by the Author and / or copyright holder.
// * Any use wihtout proper permission is illegal and may lead to legal actions.
// *
// *
// **/
using System;
namespace ln.identities
{
public class Roles : int
{
SUPERUSER = -1,
READ = (1<<0),
WRITE = (1<<1)
OWNER,
}
}