BlazorShared and Services (#430)

* Service to Services

* Change Shared project to BlazorShared

* change refrerances to BlazorShared
This commit is contained in:
Shady Nagy
2020-07-25 23:28:21 +02:00
committed by GitHub
parent f4bfc81fe8
commit e1f9ddd192
46 changed files with 87 additions and 76 deletions

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BlazorShared.Authorization
{
public class ClaimValue
{
public ClaimValue()
{
}
public ClaimValue(string type, string value)
{
Type = type;
Value = value;
}
public string Type { get; set; }
public string Value { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BlazorShared.Authorization
{
public class Constants
{
public static class Roles
{
public const string ADMINISTRATORS = "Administrators";
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Text;
namespace BlazorShared.Authorization
{
public class UserInfo
{
public static readonly UserInfo Anonymous = new UserInfo();
public bool IsAuthenticated { get; set; }
public string NameClaimType { get; set; }
public string RoleClaimType { get; set; }
public IEnumerable<ClaimValue> Claims { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>BlazorShared</RootNamespace>
<AssemblyName>BlazorShared</AssemblyName>
</PropertyGroup>
</Project>