import {Toast,} from "@ant-design/react-native";
import SyncStorage from "sync-storage";

const CheckPrem = (navetion, premission, check = true) => {
    const premissions = SyncStorage.get('premissions');
    if (navetion && check) {
        if (!premission || premissions[premission]) {
            return true
        } else {
            Toast.info("您暂无权限使用此功能", 1)
            return false
        }
    } else {
        Toast.info("该功能正在加班研发中...", 1)
        return false
    }
}

export default CheckPrem;
