diff options
| author | Michalis Adamidis <gsnerf@gsnerf.de> | 2014-09-15 02:20:45 +0200 |
|---|---|---|
| committer | Michalis Adamidis <gsnerf@gsnerf.de> | 2014-09-15 02:20:45 +0200 |
| commit | 671d302a92f79ec9c65dbae9c46a342038bfee96 (patch) | |
| tree | 4b48ad27a1f01dff2e2e07aef8975fed2cb6d71e /MediaBrowser.Controller/Net/AuthenticatedAttribute.cs | |
| parent | 7690608ed578d3c1dbf3849122107af503855a81 (diff) | |
| parent | 6babe4f5103c83d75da1924027f6e13aea165085 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Controller/Net/AuthenticatedAttribute.cs')
| -rw-r--r-- | MediaBrowser.Controller/Net/AuthenticatedAttribute.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs index 329dbaa46..31bb7c66b 100644 --- a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs +++ b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs @@ -1,5 +1,6 @@ using ServiceStack.Web; using System; +using System.Linq; namespace MediaBrowser.Controller.Net { @@ -13,6 +14,8 @@ namespace MediaBrowser.Controller.Net /// <value><c>true</c> if [allow local]; otherwise, <c>false</c>.</value> public bool AllowLocal { get; set; } + public string Roles { get; set; } + /// <summary> /// The request filter is executed before the service. /// </summary> @@ -21,7 +24,11 @@ namespace MediaBrowser.Controller.Net /// <param name="requestDto">The request DTO</param> public void RequestFilter(IRequest request, IResponse response, object requestDto) { - AuthService.Authenticate(request, response, requestDto, AllowLocal); + var roles = (Roles ?? string.Empty).Split(',') + .Where(i => !string.IsNullOrWhiteSpace(i)) + .ToArray(); + + AuthService.Authenticate(request, response, requestDto, AllowLocal, roles); } /// <summary> |
