Moved share permission parsing to jsonb implementation of ef core. Improved auth handling for shares
This commit is contained in:
@@ -132,9 +132,13 @@ public class VariablesController : Controller
|
||||
if (server == null)
|
||||
throw new HttpApiException("No server with this id found", 404);
|
||||
|
||||
if (!await AuthorizeService.Authorize(User, server,
|
||||
permission => permission.Name == "variables" && permission.Type >= type))
|
||||
throw new HttpApiException("No server with this id found", 404);
|
||||
var authorizeResult = await AuthorizeService.Authorize(
|
||||
User, server,
|
||||
permission => permission.Name == "variables" && permission.Type >= type
|
||||
);
|
||||
|
||||
if (!authorizeResult.Succeeded)
|
||||
throw new HttpApiException("No permission for the requested resource", 403);
|
||||
|
||||
return server;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user