Twill + Spatie permissions

How would someone go about implementing spatie permissions in Twill. The spatie permissions are pretty comprehensive. For e.g If i wanted certain articles in a module article to be accessible only to a certain group, Twill doesn't have permission management for such a scenario. So how would one implement them in the CMS?
I
ifox350d ago
Twill 3 permission management does have this capability now you may still want to manage permissions differently and I'm sure it'd be relatively straightforward to integrate spatie permissions with your modules
Z
.zeenux350d ago
twill permissions allow me to assign a single item to a User, not for a group (i.e a role)
I
ifox350d ago
I see. There's a feature that allow adding a permission to all users of s group in s single operation but I guess that's not granular enough for your needs it is technically possible to assign item permissions to groups instead of users, so we might want to make some progress there instead of trying to integrate spatie-permissions?
Z
.zeenux350d ago
that would be ideal How do you assign item permissions to groups? @ifox.dev any pointers?
PB
Patrick Boivin350d ago
@.zeenux, I think these should work for programmatic group permissions :
$group->grantModulePermission($permissionName, $model);

$group->grantModuleItemPermission($permissionName, $item);
$group->grantModulePermission($permissionName, $model);

$group->grantModuleItemPermission($permissionName, $item);
Want results from more Discord servers?
Add your server
More Posts
v3 package resources / blade templatesI created a fresh v3 package but inside the documentation I can’t find a description on how to add bv3 Package creation - version mismatchHey, I started installing twill 3 n a fresh Jetstream based laravel App. I could also create my firHi, do you know where I can add another link?Aligned with All Items, Published, Draft and Trashed. I just want to add new linkTwill advanced permissionsI've followed the documentation with regard to adding the enabled and permission key to config/twillUpdating Translations from the Command LineHi all, as usual I assume I'm misunderstanding something basic about how Laravel works, but I have bPreview ModulesHey how do you go about previewing modules? There is not a lot of documentation available. How do yoLegacy Settings Sections return values doesn't workHi, After save Settings to database, values doesn't bind in inputs. How fixed this @ifox.dev ?New module item errorWhen i make a new module i get this error, i'm using the twill metadata pacakage ```Object { messagCustom form fieldsI'm trying to make a custom form field to override the custom WYSIWYG form field. I've followed thiNew Settings approachHey, a i have a small question - how build a settings page like in https://demo.twill.io/settings/seRender repeater in block blade fileI have made a block named "gallery" with a repeater containing medias named "gallery-item", please hFetch all images in a blockHow do you fetch all the images in a block? For e.g i have this block <x-twill::medias name="slRepeater without blocksHow do you add and render a repeater without including it in the block?Adding custom blocks to modulesHow do you add custom blocks to modules? Generally i add blocks to a module using $form->add(BlockEd$renderData returns null when trying to render nestedblocks@php /** @var \A17\Twill\Services\Blocks\RenderData $renderData */ dd($renderData) Fetch all models with field value of XSorry to ask such a basic question but I want to do the following.... I have a model called Work (anDisplaying Block elements on the Front Pagehow do you display block elements on the frontpage? And i don't mean the preview file. I want to accdashboard routeHello. I have a problem with dashboard config I have a Category and CategoryArticle Models I have aTwill Role based accessHow would i go about adding a Role based access to CMS Components and its entries. For e.g in an imaTwill assets errorHello to everyone i have an website in production builded in twill but some twill assets in there a