diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-31 15:02:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-31 15:02:03 +0800 |
commit | 37a2e6340ab20de1f9e847d795c0cbec9846de97 (patch) | |
tree | ba42530cf4f13621a7a3a7ff661e383117119883 /Timeline/Auth/PrincipalExtensions.cs | |
parent | a175f8328d7a6c36464676d54fc50d03e64be0af (diff) | |
parent | 2c3744ab5db476b64a32c19b50153e3e6166b0e6 (diff) | |
download | timeline-37a2e6340ab20de1f9e847d795c0cbec9846de97.tar.gz timeline-37a2e6340ab20de1f9e847d795c0cbec9846de97.tar.bz2 timeline-37a2e6340ab20de1f9e847d795c0cbec9846de97.zip |
Merge pull request #53 from crupest/nickname
Add nickname support.
Diffstat (limited to 'Timeline/Auth/PrincipalExtensions.cs')
-rw-r--r-- | Timeline/Auth/PrincipalExtensions.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Timeline/Auth/PrincipalExtensions.cs b/Timeline/Auth/PrincipalExtensions.cs new file mode 100644 index 00000000..ad7a887f --- /dev/null +++ b/Timeline/Auth/PrincipalExtensions.cs @@ -0,0 +1,13 @@ +using System.Security.Principal;
+using Timeline.Entities;
+
+namespace Timeline.Auth
+{
+ internal static class PrincipalExtensions
+ {
+ internal static bool IsAdministrator(this IPrincipal principal)
+ {
+ return principal.IsInRole(UserRoles.Admin);
+ }
+ }
+}
|