feat(authorization): add read connection checks

This commit is contained in:
Ali BARIN
2023-06-23 20:20:42 +00:00
parent 63abc8a2c8
commit c37c70446d
3 changed files with 6 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import { IConnection } from '@automatisch/types';
import App from '../../models/app';
import Context from '../../types/express/context';
import { IApp, IConnection } from '@automatisch/types';
type Params = {
name: string;
@@ -11,6 +11,8 @@ const getConnectedApps = async (
params: Params,
context: Context
) => {
context.currentUser.can('read', 'Connection');
let apps = await App.findAll(params.name);
const connections = await context.currentUser