Permissions & Authorization for Users #24

Initial Release; Includes Database and MVC refactoring
This commit is contained in:
Gary Sharp
2013-10-10 19:13:16 +11:00
parent 172ce5524a
commit a099d68915
458 changed files with 40221 additions and 12130 deletions
@@ -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; }
}
}
+15
View File
@@ -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; }
}
}