openpanel/packages/cli/templates/provider/demo-access-control-provider.tsx.template
Stefan Pejcic 09f9f9502d packages
2024-11-07 19:03:37 +01:00

26 lines
607 B
Plaintext

import { AccessControlProvider } from "@refinedev/core";
/**
* Check out the Access Control Provider documentation for detailed information
* https://refine.dev/docs/api-reference/core/providers/accessControl-provider
**/
export const accessControlProvider: AccessControlProvider = {
can: async ({ resource, action, params }) => {
console.log("can", {
resource,
action,
params,
});
// TODO: control if the user can do the action
return { can: true };
},
options: {
buttons: {
enableAccessControl: true,
hideIfUnauthorized: false,
},
},
};