@@ -33,6 +33,8 @@ public MergeController(
33
33
/// <returns> List of ids of new words </returns>
34
34
[ HttpPut ( Name = "MergeWords" ) ]
35
35
[ ProducesResponseType ( StatusCodes . Status200OK , Type = typeof ( List < string > ) ) ]
36
+ [ ProducesResponseType ( StatusCodes . Status400BadRequest , Type = typeof ( string ) ) ]
37
+ [ ProducesResponseType ( StatusCodes . Status403Forbidden ) ]
36
38
public async Task < IActionResult > MergeWords (
37
39
string projectId , [ FromBody , BindRequired ] List < MergeWords > mergeWordsList )
38
40
{
@@ -58,6 +60,7 @@ public async Task<IActionResult> MergeWords(
58
60
/// <returns> True if merge was successfully undone </returns>
59
61
[ HttpPut ( "undo" , Name = "UndoMerge" ) ]
60
62
[ ProducesResponseType ( StatusCodes . Status200OK , Type = typeof ( bool ) ) ]
63
+ [ ProducesResponseType ( StatusCodes . Status403Forbidden ) ]
61
64
public async Task < IActionResult > UndoMerge ( string projectId , [ FromBody , BindRequired ] MergeUndoIds merge )
62
65
{
63
66
if ( ! await _permissionService . HasProjectPermission (
@@ -75,6 +78,7 @@ public async Task<IActionResult> UndoMerge(string projectId, [FromBody, BindRequ
75
78
/// <returns> List of word ids added to blacklist. </returns>
76
79
[ HttpPut ( "blacklist/add" , Name = "BlacklistAdd" ) ]
77
80
[ ProducesResponseType ( StatusCodes . Status200OK , Type = typeof ( List < string > ) ) ]
81
+ [ ProducesResponseType ( StatusCodes . Status403Forbidden ) ]
78
82
public async Task < IActionResult > BlacklistAdd ( string projectId , [ FromBody , BindRequired ] List < string > wordIds )
79
83
{
80
84
if ( ! await _permissionService . HasProjectPermission (
@@ -92,6 +96,7 @@ public async Task<IActionResult> BlacklistAdd(string projectId, [FromBody, BindR
92
96
/// <returns> List of word ids added to graylist. </returns>
93
97
[ HttpPut ( "graylist/add" , Name = "graylistAdd" ) ]
94
98
[ ProducesResponseType ( StatusCodes . Status200OK , Type = typeof ( List < string > ) ) ]
99
+ [ ProducesResponseType ( StatusCodes . Status403Forbidden ) ]
95
100
public async Task < IActionResult > GraylistAdd ( string projectId , [ FromBody , BindRequired ] List < string > wordIds )
96
101
{
97
102
if ( ! await _permissionService . HasProjectPermission (
@@ -111,6 +116,7 @@ public async Task<IActionResult> GraylistAdd(string projectId, [FromBody, BindRe
111
116
/// <param name="maxLists"> Max number of lists of potential duplicates. </param>
112
117
[ HttpGet ( "finddups/{maxInList:int}/{maxLists:int}" , Name = "FindPotentialDuplicates" ) ]
113
118
[ ProducesResponseType ( StatusCodes . Status200OK ) ]
119
+ [ ProducesResponseType ( StatusCodes . Status403Forbidden ) ]
114
120
public async Task < IActionResult > FindPotentialDuplicates ( string projectId , int maxInList , int maxLists )
115
121
{
116
122
if ( ! await _permissionService . HasProjectPermission (
@@ -145,6 +151,7 @@ internal async Task<bool> GetDuplicatesThenSignal(string projectId, int maxInLis
145
151
/// <returns> List of Lists of <see cref="Word"/>s, each sublist a set of potential duplicates. </returns>
146
152
[ HttpGet ( "retrievedups" , Name = "RetrievePotentialDuplicates" ) ]
147
153
[ ProducesResponseType ( StatusCodes . Status200OK , Type = typeof ( List < List < Word > > ) ) ]
154
+ [ ProducesResponseType ( StatusCodes . Status400BadRequest ) ]
148
155
public IActionResult RetrievePotentialDuplicates ( )
149
156
{
150
157
var userId = _permissionService . GetUserId ( HttpContext ) ;
@@ -157,6 +164,7 @@ public IActionResult RetrievePotentialDuplicates()
157
164
/// <param name="userId"> Id of user whose merge graylist is to be used. </param>
158
165
[ HttpGet ( "hasgraylist/{userId}" , Name = "HasGraylistEntries" ) ]
159
166
[ ProducesResponseType ( StatusCodes . Status200OK , Type = typeof ( bool ) ) ]
167
+ [ ProducesResponseType ( StatusCodes . Status403Forbidden ) ]
160
168
public async Task < IActionResult > HasGraylistEntries ( string projectId , string userId )
161
169
{
162
170
if ( ! await _permissionService . HasProjectPermission (
@@ -174,6 +182,7 @@ public async Task<IActionResult> HasGraylistEntries(string projectId, string use
174
182
/// <returns> List of Lists of <see cref="Word"/>s. </returns>
175
183
[ HttpGet ( "getgraylist/{maxLists}/{userId}" , Name = "GetGraylistEntries" ) ]
176
184
[ ProducesResponseType ( StatusCodes . Status200OK , Type = typeof ( List < List < Word > > ) ) ]
185
+ [ ProducesResponseType ( StatusCodes . Status403Forbidden ) ]
177
186
public async Task < IActionResult > GetGraylistEntries (
178
187
string projectId , int maxLists , string userId )
179
188
{
0 commit comments