clean up and various little improvements after search for static wasted memory objects (not found) At this point it appears I don't have any leaks and it's all pretty efficient.
This commit is contained in:
@@ -56,7 +56,7 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
/// <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);
|
||||
@@ -120,14 +120,6 @@ 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;
|
||||
|
||||
// if (currentUserRoles.HasAnyFlags(BizRoles.GetRoleSet(objectType).ReadFullRecord))
|
||||
// return true;
|
||||
|
||||
//return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,14 +146,10 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
{
|
||||
if (currentUserRoles.HasAnyFlags(BizRoles.GetRoleSet(objectType).Change))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MODIFY
|
||||
/// </summary>
|
||||
@@ -172,7 +160,6 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
internal static bool HasModifyRole(IDictionary<object, object> HttpContextItems, AyaType objectType)
|
||||
{
|
||||
AuthorizationRoles currentUserRoles = UserRolesFromContext.Roles(HttpContextItems);
|
||||
|
||||
return HasModifyRole(currentUserRoles, objectType);
|
||||
}
|
||||
|
||||
@@ -219,8 +206,6 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
{
|
||||
if (currentUserRoles.HasAnyFlags(BizRoles.GetRoleSet(objectType).Change))
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user