Skip to content

Commit

Permalink
Added SearchParameter Data Action. Will be used to create a new role. (
Browse files Browse the repository at this point in the history
  • Loading branch information
PTaladay authored Jun 6, 2023
1 parent e261f9c commit cee4655
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public enum DataActions : ulong
ConvertData = 1 << 7,
EditProfileDefinitions = 1 << 8, // Allows to Create/Update/Delete resources related to profile's resources.
Import = 1 << 9,
SearchParameter = 1 << 10,

Smart = 1 << 30, // Do not include Smart in the '*' case. We only want smart for a user if explicitly added to the role or user

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"convertData",
"import",
"editProfileDefinitions",
"smart"
"smart",
"searchParameter"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public SearchParameterStateUpdateHandlerTests()
_searchParameterStateUpdateHandler = new SearchParameterStateUpdateHandler(_authorizationService, _searchParameterStatusManager, _logger2);
_cancellationToken = CancellationToken.None;

_authorizationService.CheckAccess(DataActions.Reindex, _cancellationToken).Returns(DataActions.Reindex);
_authorizationService.CheckAccess(DataActions.SearchParameter, _cancellationToken).Returns(DataActions.SearchParameter);
var searchParamDefinitionStore = new List<SearchParameterInfo>
{
new SearchParameterInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task<SearchParameterStateUpdateResponse> Handle(SearchParameterStat
{
EnsureArg.IsNotNull(request, nameof(request));

if (await _authorizationService.CheckAccess(DataActions.Reindex, cancellationToken) != DataActions.Reindex)
if (await _authorizationService.CheckAccess(DataActions.SearchParameter, cancellationToken) != DataActions.SearchParameter)
{
throw new UnauthorizedFhirActionException();
}
Expand Down

0 comments on commit cee4655

Please # to comment.