ayType aytype all now AyaType or ayaType

This commit is contained in:
2020-05-15 21:08:37 +00:00
parent 7806e0df26
commit 8f3118d309
11 changed files with 77 additions and 42 deletions

View File

@@ -37,7 +37,30 @@ namespace AyaNova.Api.ControllerHelpers
return false;
}
/// <summary>
/// any access at all?
/// </summary>
/// <param name="HttpContextItems"></param>
/// <param name="objectType"></param>
/// <returns></returns>
internal static bool HasAnyRole(IDictionary<object, object> HttpContextItems, AyaType objectType)
{
AuthorizationRoles currentUserRoles = UserRolesFromContext.Roles(HttpContextItems);
return HasAnyRole(currentUserRoles, objectType);
}
/// <summary>
/// User has any access at all to this object?
/// </summary>
/// <param name="currentUserRoles"></param>
/// <param name="objectType"></param>
/// <returns></returns>
internal static bool HasAnyRole(AuthorizationRoles currentUserRoles, AyaType objectType)
{
var RoleSet = BizRoles.GetRoleSet(objectType);
var AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change | RoleSet.Select;
return currentUserRoles.HasAnyFlags(AllowedRoles);
}
/// <summary>
/// READ FULL RECORD (not just name and id)
@@ -97,7 +120,7 @@ namespace AyaNova.Api.ControllerHelpers
var RoleSet = BizRoles.GetRoleSet(objectType);
var AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
return currentUserRoles.HasAnyFlags(AllowedRoles);
// if (currentUserRoles.HasAnyFlags(BizRoles.GetRoleSet(objectType).Change))
// return true;