Permissions & Authorization for Users #24
Initial Release; Includes Database and MVC refactoring
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Disco.Models.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Authorization
|
||||
{
|
||||
public interface IAuthorizationToken
|
||||
{
|
||||
User User { get; set; }
|
||||
List<string> GroupMembership { get; set; }
|
||||
List<IRoleToken> RoleTokens { get; set; }
|
||||
|
||||
bool HasAny(params string[] ClaimKeys);
|
||||
bool HasAny(IEnumerable<string> ClaimKeys);
|
||||
bool HasAll(params string[] ClaimKeys);
|
||||
bool HasAll(IEnumerable<string> ClaimKeys);
|
||||
bool Has(string ClaimKey);
|
||||
|
||||
void Require(string ClaimKey);
|
||||
void RequireAll(params string[] ClaimKeys);
|
||||
void RequireAny(params string[] ClaimKeys);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Authorization
|
||||
{
|
||||
public interface IClaimNavigatorItem
|
||||
{
|
||||
string Key { get; }
|
||||
string Name { get; }
|
||||
string Description { get; }
|
||||
bool Hidden { get; }
|
||||
|
||||
List<IClaimNavigatorItem> Children { get; }
|
||||
bool IsGroup { get; }
|
||||
bool? Value { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Disco.Models.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Authorization
|
||||
{
|
||||
public interface IRoleToken
|
||||
{
|
||||
AuthorizationRole Role { get; set; }
|
||||
List<string> SubjectIds { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user