@ra-libs/react-rbac
Version:
React admin RBAC front components and utils
13 lines • 435 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useCASL = useCASL;
const react_1 = require("react");
const CASLContext_1 = require("./CASLContext");
function useCASL() {
const context = (0, react_1.useContext)(CASLContext_1.CASLContext);
if (!context) {
throw new Error('useCASL can only be used within CASLProvider');
}
return context;
}
//# sourceMappingURL=useCASL.js.map