We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
am using keystone-5-app and access control not working properly. am using below code
A clear and concise description of the bug. Only access control not working as expected
i provide code below Steps to reproduce the behaviour. Please provide code snippets or a repository:
user can crud their own resources A clear and concise description of what you expected to happen.
// Access control functions const isAdmin = ({ authentication: { item: user } }) => Boolean(user && user.isAdmin); const isLoggedIn = ({ authentication: { item: user } }) => Boolean(user); const isOwner = ({ authentication: { item: user } }) => { if (!user) { return false; } return { id: user.id }; }; const isAdminOrOwner = (auth) => { console.log(auth); const isAdmin = access.isAdmin(auth); const isOwner = access.isOwner(auth); return isAdmin ? isAdmin : isOwner; }; const access = { isAdmin, isLoggedIn, isOwner, isAdminOrOwner }; keystone.createList('Post', { fields: PostSchema.fields, // List-level access controls access: { read: true, update: access.isAdminOrOwner, create: access.isLoggedIn, delete: access.isAdminOrOwner, auth: true, }, });
If applicable, add screenshots to help explain your problem.
windows 10
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug report
Describe the bug
am using keystone-5-app and access control not working properly. am using below code
A clear and concise description of the bug.
Only access control not working as expected
To Reproduce
i provide code below
Steps to reproduce the behaviour. Please provide code snippets or a repository:
Expected behaviour
user can crud their own resources
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
windows 10
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: