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))); }); }
/// <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); }
public ProjectsManager() { _authHelper = new AuthorisationHelper(); }
public HomeController() { _authHelper = new AuthorisationHelper(); _manager = new ProjectsManager(); }