New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

directus-extension-current-role-hook

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

directus-extension-current-role-hook

This hook injects the current user role in the DOM

latest
Source
npmnpm
Version
0.2.4
Version published
Maintainers
1
Created
Source

Banner

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

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

  • Data attribute gets injected in the body element.

Screenshot 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.

Keywords

directus

FAQs

Package last updated on 22 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts