#How to access user role name in Field interface fi...

21 messages · Page 1 of 1 (latest)

west peakBOT
#

Hey @random birch, we've moved your question here. In future, please ask questions in one of the help channels as per the server rules.

Your original message was:
How to access user role name in Field interface filter.

I want to apply filter on field based on user role. I'm trying to access it like this $CURRENT_USER.role.name but it is not working.
Can someone tell me what is inside $CURRENT_USER

If there was additional context, @astral reef will add it here for you. Your original post has been deleted.

#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please make sure your question includes the following:

  • An explanation of exactly what you're trying to achieve.
  • Any and all related code or previous attempts.
  • The exact issue or error you are facing.
  • Any screenshots if applicable.

When you're done with this thread, please close it.

(If you have a support agreement and need help, please contact the core team via email.)

astral reef
random birch
#

Why it's not allowed is there any restriction or is it hard to implement this ?

#

If there is no restriction we can make PR

random birch
#

Can you please guide me a little bit How can I implement this functionality

random birch
#

I'm trying to run directus locally pnpm -r dev This does not show where the app is running

astral reef
random birch
#

Yes I also tried it but app is continuously loading and never show anything on frontend side.
Here are my .env files
under API folder -> .env

HOST="localhost"
PORT=8055

DB_CLIENT="mysql"
DB_HOST="127.0.0.1"
DB_PORT="3306"
DB_DATABASE="fsp_dashboard"
DB_USER="admin"
DB_PASSWORD="password"


KEY="d1b865f6-05cb-4752-ba37-bcbd6c0904c0"
SECRET="rfYPSkb2p1WMWTFDm0Fa94cHHIbwuSb5"

and on root path .env

# IP or host the API listens on ["0.0.0.0"]
HOST="localhost"

# The port Directus will run on [8055]
PORT=8080

# The URL where your API can be reached on the web. It is also used for things like OAuth redirects,
# forgot-password emails, and logos that needs to be publicly available on the internet. ["/"]
PUBLIC_URL="http://localhost:8055"

I also used PUBLIC_URL="http://localhost:8055/admin" but this one also not working.
My frontend application continuously in loading state and does not show anything

astral reef
#

only the .env in /api is used, as mentioned in the docs

random birch
#

Still same problem

#

frontend application is loading and nothing showing

astral reef
#

looks to be working as such by the log, probably got some CORS errors in the browser or similar

random birch
#

But there is no error in console I also check the networking tab

#

There are some pending requests which are not resolve. I don't know why they stay in Pending

random birch
#

I made a PR which allow to use nested properties of user for example $CURRENT_USER.first_name