Pass Model into Default Value Function #657
Replies: 2 comments
-
Hey @gkemp94 — this should be doable in quite a few different ways actually. First, I believe you are asking to have access to the Mongoose But, I think you can do this solely with access control and maybe a custom role component to be able to restrict select values based on the logged in user. For example, put an access control function on the role field, and within the access control, check if there are users created. IF there are users, then prevent a user from adding a role of Does this make sense? |
Beta Was this translation helpful? Give feedback.
-
I think that makes sense. My use case is that when I start up payload I want to be able to have access to the admin, however I also want users to be able to register (in a future front-end) and those users not automatically have access to the admin. Based on this though, perhaps that logic could be in the acess.admin. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Would love to enable the ability for the first user to have a different role. If I set it as "Admin" by default new users get access to everything. If I set it as "Guest" they can't access admin and change their role to admin. Bit of a catch-22.
Beta Was this translation helpful? Give feedback.
All reactions