0.2.3 • Published 1 month ago

directus-extension-current-role-hook v0.2.3

Weekly downloads
-
License
-
Repository
github
Last release
1 month ago

Current Role

This hook injects the current user ID and role in the body element of the Data Studio. This is useful when you want to apply custom CSS to a specific user or role.

Usage

  1. Install the extension using a package manager or from the Marketplace:
npm install directus-extension-current-role-hook
  1. Restart Directus.

  2. Data attribute gets injected in the body element.

Screenshot 1

  1. Add your custom CSS:
body[data-user-id="..."] {
  /* custom css */
}

body[data-user-role="..."] {
  /* custom css */
}

Known Issues

  • After installing the extension, you'll have to restart Directus for the extension to work.
  • HTML attributes aren't injected after logging in because, upon initial load, the request to retrieve the user would be unauthenticated.
0.2.3

1 month ago

0.2.2

2 months ago

0.2.1

2 months ago

0.2.0

2 months ago

0.1.0

3 months ago