feat: Implement get role mappings API endpoint

This commit is contained in:
Faruk AYDIN
2024-03-14 15:46:08 +01:00
parent 29341f81e1
commit 64049bd546
7 changed files with 125 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { renderObject } from '../../../../../helpers/renderer.js';
import SamlAuthProvider from '../../../../../models/saml-auth-provider.ee.js';
export default async (request, response) => {
const samlAuthProvider = await SamlAuthProvider.query()
.findById(request.params.samlAuthProviderId)
.throwIfNotFound();
const roleMappings = await samlAuthProvider
.$relatedQuery('samlAuthProvidersRoleMappings')
.orderBy('remote_role_name', 'asc');
renderObject(response, roleMappings);
};