Helper function to check if user has a specific role
Role name to check
Table containing user roles (default: 'user_roles')
A ConditionChain that can be chained with .and() or .or()
policy('admin_access') .on('admin_data') .for('SELECT') .when(hasRole('admin')) Copy
policy('admin_access') .on('admin_data') .for('SELECT') .when(hasRole('admin'))
Helper function to check if user has a specific role