-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
exposes required permissions to users next to the header with a shiel… (
#2011) * exposes required permissions to users next to the header with a shield icon * fix test project build
- Loading branch information
1 parent
0329372
commit a65ac08
Showing
10 changed files
with
97 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
namespace TASVideos.Extensions; | ||
using TASVideos.Pages; | ||
|
||
namespace TASVideos.Extensions; | ||
|
||
public static class HttpContextExtensions | ||
{ | ||
public static string CurrentPathToReturnUrl(this HttpContext? context) | ||
{ | ||
return context is null ? "" : $"{context.Request.Path}{context.Request.QueryString}"; | ||
} | ||
|
||
public static void SetRequiredPermissionsView(this HttpContext? context, RequirePermissionsView requiredPermissions) | ||
{ | ||
if (context is not null) | ||
{ | ||
context.Items["RequiredPermissions"] = requiredPermissions; | ||
} | ||
} | ||
|
||
public static RequirePermissionsView? GetRequiredPermissionsView(this HttpContext? context) | ||
{ | ||
return context?.Items["RequiredPermissions"] as RequirePermissionsView; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters