ayType aytype all now AyaType or ayaType
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user