/// <summary> /// Checks a single StoreFront permission for the specified user. /// </summary> /// <param name="storeFront"></param> /// <param name="userProfile"></param> /// <param name="action"></param> /// <returns></returns> public static bool Authorization_IsAuthorized(this StoreFront storeFront, UserProfile userProfile, Identity.GStoreAction action) { if (userProfile == null) { return(false); } if (userProfile.AspNetIdentityUserIsInRoleSystemAdmin()) { return(true); } if (storeFront == null) { return(false); } return(CheckSinglePermission(userProfile, storeFront, action)); }
/// <summary> /// Verifies the current logged on user has permission to a specific GStoreAction for the current StoreFront, otherwise prompts to log in /// </summary> /// <param name="action"></param> public AuthorizeGStoreAction(Identity.GStoreAction action) { _actions = new List <GStoreAction>(); _actions.Add(action); _allowAnyMatch = true; }
/// <summary> /// Checks a single StoreFront permission for the specified user. /// </summary> /// <param name="userProfile"></param> /// <param name="storeFront"></param> /// <param name="action"></param> /// <returns></returns> public static bool Authorization_IsAuthorized(this UserProfile userProfile, StoreFront storeFront, Identity.GStoreAction action) { return(storeFront.Authorization_IsAuthorized(userProfile, action)); }