mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
26 lines
691 B
TypeScript
26 lines
691 B
TypeScript
import { CanParams, IAccessControlContext } 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: IAccessControlContext = {
|
|
can: async ({ resource, action, params }: CanParams) => {
|
|
console.log("can", {
|
|
resource,
|
|
action,
|
|
params,
|
|
});
|
|
|
|
// TODO: control if the user can do the action
|
|
|
|
return { can: true };
|
|
},
|
|
options: {
|
|
buttons: {
|
|
enableAccessControl: true,
|
|
hideIfUnauthorized: false,
|
|
},
|
|
},
|
|
};
|