diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-07 21:26:06 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-07 21:26:06 +0300 |
| commit | 98c2921a8cf655da3962edafe91bbccc89632e6d (patch) | |
| tree | 95419d7651d8bcb8e3b2a58af884231c0e91cb0f /Software/Visual_Studio/FSE/Tango.FSE.BL | |
| parent | 070db71577b05f72e7531d0e530a4ef5bd1d128a (diff) | |
| download | Tango-98c2921a8cf655da3962edafe91bbccc89632e6d.tar.gz Tango-98c2921a8cf655da3962edafe91bbccc89632e6d.zip | |
Roles & Permissions !
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.BL')
3 files changed, 28 insertions, 0 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/AuthorizationException.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/AuthorizationException.cs new file mode 100644 index 000000000..301c2482b --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/AuthorizationException.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.BL +{ + public class AuthorizationException : Exception + { + public AuthorizationException() : base("Insufficient privileges to perform the specified action.") + { + + } + + public AuthorizationException(String message) : base(message) + { + + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/PublishedTestProjectsService.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/PublishedTestProjectsService.cs index a8b5d9f0b..1f8476480 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/PublishedTestProjectsService.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/PublishedTestProjectsService.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using Tango.BL; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.FSE.BL.CacheEntities; using Z.EntityFramework.Plus; @@ -106,6 +107,11 @@ namespace Tango.FSE.BL.Services { return Task.Factory.StartNew<PublishedTestProject>(() => { + if (!CurrentUser.HasPermission(Permissions.FSE_PublishTestProjects)) + { + throw new AuthorizationException(); + } + if (!ConnectivityProvider.CheckOnline()) { throw new InternetConnectionException(); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj index 98addeeaa..e548b03db 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj @@ -80,6 +80,7 @@ </Reference> </ItemGroup> <ItemGroup> + <Compile Include="AuthorizationException.cs" /> <Compile Include="CacheEntities\CachedEventType.cs" /> <Compile Include="CacheEntities\CachedPublishedTestProject.cs" /> <Compile Include="EntityRepositoryBase.cs" /> |
