import React, {createContext} from 'react';
import {createUserAbility} from "../utils/UserAbilityUtils";
import {getUserAuthList} from "../utils/CommonFunction";

const AbilityContext = createContext();

export const AbilityProvider = ({ children }) => {
    const ability = createUserAbility(getUserAuthList());
    return (
        <AbilityContext.Provider value={ability}>
            {children}
        </AbilityContext.Provider>
    );
};

export default AbilityContext;

