public async Task UnAuthorisedOnList()
 {
     await AuthorisationHelper.VerifyContractorUnauthorised(
         CreateClient(),
         GetGroup(TestDataSeeder.Contractor),
         async client => await client.GetAsync(new Uri("/api/v2/appointments", UriKind.Relative)));
 }
 public async Task ContractorAuthorisationTests(string test)
 {
     await AuthorisationHelper.VerifyAgentUnauthorised(
         CreateClient(),
         async client =>
     {
         return(await client.GetAsync(new Uri(test, UriKind.Relative)));
     });
 }
 public async Task AuthorisationTests(string test)
 {
     await AuthorisationHelper.VerifyContractorUnauthorised(
         Client,
         GetGroup(TestDataSeeder.Contractor),
         async client =>
     {
         return(await client.GetAsync(new Uri(test, UriKind.Relative)));
     });
 }
Beispiel #4
0
        /// <summary>
        /// <see cref="ISecureFilerReader.RoleBasedFileRead(string filePath, ApplicationRoles userRole)"/>
        /// </summary>
        public virtual string RoleBasedFileRead(string filePath, ApplicationRoles userRole)
        {
            string fileContent = string.Empty;

            if (AuthorisationHelper.CanReadFile(filePath, userRole))
            {
                fileContent = this.ReadFile(filePath);
            }

            return(fileContent);
        }
Beispiel #5
0
 public ProjectsManager()
 {
     _authHelper = new AuthorisationHelper();
 }
Beispiel #6
0
 public HomeController()
 {
     _authHelper = new AuthorisationHelper();
     _manager    = new ProjectsManager();
 }