<!--- CheckPagePermissions.stories.mdx --->

import { ArgsTable, Meta } from '@storybook/addon-docs';
import CheckPagePermissions from './index';

<Meta title="components/CheckPagePermissions" />

# CheckPagePermissions

This component is used in order to apply RBAC to a view. If the user does not have the permissions to access the view he will be redirect to the homepage:

## Usage

```
import { CheckPagePermissions } from '@strapi/helper-plugin';

const permissions = [{ action: 'plugins::my-plugin.access', subject: null }];

const HomePage = () => {
  return (
    <CheckPagePermissions permissions={permissions}>
      <main>
        <h1>This is the homepage</h1>
      </main>
    </CheckPagePermissions>
  );
};
```

<ArgsTable of={CheckPagePermissions} />
