permission.ts 824 Bytes
Newer Older
Maxym Borodenko's avatar
Maxym Borodenko committed
1
2
3
4
5
6
import {PermissionService} from 'service/PermissionService';
import {log} from 'utilities/debug';
import {SidPermissions} from 'model/acl.model';

export const permissions = (clazz: string, id: number) => (dispatch, getState) => {

7
    return PermissionService.permissions(clazz, id)
Maxym Borodenko's avatar
Maxym Borodenko committed
8
9
10
11
12
13
14
        .catch((error) => {
            log('Error', error);
        });
};

export const addPermission = (clazz: string, id: number, sidPermissions: SidPermissions) => (dispatch, getState) => {

15
    return PermissionService.addPermission(clazz, id, sidPermissions)
Maxym Borodenko's avatar
Maxym Borodenko committed
16
17
18
19
20
21
22
        .catch((error) => {
            log('Error', error);
        });
};

export const autocomplete = (term: string) => (dispatch, getState) => {

23
    return PermissionService.autocomplete(term)
Maxym Borodenko's avatar
Maxym Borodenko committed
24
25
26
27
        .catch((error) => {
            log('Error', error);
        });
};