Update the schema for the field you have to disable for other users.
{
name: ‘approvalstatus’,
type: ‘select’,
options: [
{ label: ‘Entered’, value: ‘entered’ },
{ label: ‘Submit’, value: ‘submit’ },
{ label: ‘Approved’, value: ‘approved’ },
{ label: ‘Declined’, value: ‘declined’ },
],
label: ‘Approval Status’,
access:{
update:checkAdminRole
},
set the checkadmin role as
const checkAdminRole = ({ req: { user } }) => {
return user?.role?.includes(‘admin’);
};
the users schema has to be well organized for setting the functionality.