Skip to content

[BUG] Access control provider is executed for every row - bad performance #3945

Closed
@Mikilll94

Description

@Mikilll94

Describe the bug

I have noticed that can method from access control provider is executed for every row. This can lead to terrible performance when i.e. you need to make an http call to check permissions and have about 1000 rows. This will result in 1000 http calls.

Steps To Reproduce

  1. Open this CodeSandbox.
    https://codesandbox.io/s/sharp-snowflake-yxc8q9?file=/src/App.tsx
  2. Log in
  3. Look at the console. You will see that ACCESS CONTROL PROVIDER is printed 53 times.

Expected behavior

can method from access control provider should be executed only once.

Screenshot

No response

Desktop

  • Chrome 111.0.5563.64
  • macOS 11.6.1
  • @refinedev/core 4.5.0

Mobile

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions