aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs
diff options
context:
space:
mode:
authorstefan <stefan@hegedues.at>2018-09-12 19:26:21 +0200
committerstefan <stefan@hegedues.at>2018-09-12 19:26:21 +0200
commit48facb797ed912e4ea6b04b17d1ff190ac2daac4 (patch)
tree8dae77a31670a888d733484cb17dd4077d5444e8 /MediaBrowser.Controller/Net/AuthenticatedAttribute.cs
parentc32d8656382a0eacb301692e0084377fc433ae9b (diff)
Update to 3.5.2 and .net core 2.1
Diffstat (limited to 'MediaBrowser.Controller/Net/AuthenticatedAttribute.cs')
-rw-r--r--MediaBrowser.Controller/Net/AuthenticatedAttribute.cs66
1 files changed, 0 insertions, 66 deletions
diff --git a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs
deleted file mode 100644
index ecbfaecea..000000000
--- a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using MediaBrowser.Model.Services;
-
-namespace MediaBrowser.Controller.Net
-{
- public class AuthenticatedAttribute : Attribute, IHasRequestFilter, IAuthenticationAttributes
- {
- public static IAuthService AuthService { get; set; }
-
- /// <summary>
- /// Gets or sets the roles.
- /// </summary>
- /// <value>The roles.</value>
- public string Roles { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether [escape parental control].
- /// </summary>
- /// <value><c>true</c> if [escape parental control]; otherwise, <c>false</c>.</value>
- public bool EscapeParentalControl { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether [allow before startup wizard].
- /// </summary>
- /// <value><c>true</c> if [allow before startup wizard]; otherwise, <c>false</c>.</value>
- public bool AllowBeforeStartupWizard { get; set; }
-
- public bool AllowLocal { get; set; }
-
- /// <summary>
- /// The request filter is executed before the service.
- /// </summary>
- /// <param name="request">The http request wrapper</param>
- /// <param name="response">The http response wrapper</param>
- /// <param name="requestDto">The request DTO</param>
- public void RequestFilter(IRequest request, IResponse response, object requestDto)
- {
- AuthService.Authenticate(request, this);
- }
-
- /// <summary>
- /// Order in which Request Filters are executed.
- /// &lt;0 Executed before global request filters
- /// &gt;0 Executed after global request filters
- /// </summary>
- /// <value>The priority.</value>
- public int Priority
- {
- get { return 0; }
- }
-
- public string[] GetRoles()
- {
- return (Roles ?? string.Empty).Split(new []{ ',' }, StringSplitOptions.RemoveEmptyEntries);
- }
- }
-
- public interface IAuthenticationAttributes
- {
- bool EscapeParentalControl { get; }
- bool AllowBeforeStartupWizard { get; }
- bool AllowLocal { get; }
-
- string[] GetRoles();
- }
-}