Yancy::Help::Cookbook - Recipes for Yancy apps
version 1.064
Create another instance of the Yancy editor using Yancy::Plugin::Editor, passing in a new route, a moniker, and the exact schemas and fields you want to allow.
# Allow content editors to only edit the title, content, and # content_html of blog posts my $schema = app->yancy->schema; my $editable_properties = { %{ $schema->{blog_posts}{properties} }{qw( blog_post_id title content content_html )}, }; app->yancy->plugin( Editor => { backend => app->yancy->backend, route => '/edit', require_user => { -bool => 'is_editor', }, schema => { blog_posts => { %{ $schema->{blog_posts} }, properties => $editable_properties, }, }, } );
See https://github.com/preaction/Yancy/tree/eg/limited-editor for the complete example.
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2020 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Yancy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yancy
CPAN shell
perl -MCPAN -e shell install Yancy
For more information on module installation, please visit the detailed CPAN module installation guide.