Twill Role based access

How would i go about adding a Role based access to CMS Components and its entries. For e.g in an image module i would want to be able to allow or deny access (on the front end) to certain roles.
I
ifox375d ago
Hi @.zeenux you can either use the new permission management feature if you want to use the same users as the CMS users (using the view permission to allow access on the frontend), or build something with your own user model with a browser field on your module. In any case Twill being headless you'll need to integrate the authorization yourself on your frontend controllers by checking the permission of the authenticated user.
Z
.zeenux375d ago
Ideally i would want to attach roles/group to any resource, article, media etc. And i would want the cms to check for access rights before providing the requested resource let say an article. But i gather it isn't easy to implement. However would it be possible to add a role field to the migration, and return the resource based on that field?
I
ifox375d ago
it seems like you are looking for exactly the permission management feature: https://twillcms.com/docs/user-management/advanced-permissions.html
Twill
I
ifox375d ago
the most complex level lets you manage permissions with groups and roles down to individual records
Z
.zeenux375d ago
That's exactly what i wanted, however the documentation of this feature is pretty limited.
I
ifox375d ago
for now 😉 try it, the UI is quite self explanatory
Want results from more Discord servers?
Add your server
More Posts
Twill assets errorHello to everyone i have an website in production builded in twill but some twill assets in there aWhere to find block repositories?I've seen in the tutorial(https://www.youtube.com/watch?v=kAcJ5G2GhiA) some blocks like "paragraph &[3.0.0] Block class - getBlockTitle()Hi, I was trying to move Blade blocks to Class. When I wanted to move `@twillBlockTitleField` in cla[3.0.0] componentBlock overriding getBlockIcon doesn't seem to work?(Successfully changed the title by overriding it's static function) Checked twill:list:icon for the[3.0.0] Maintaining automated Permalink Generation when using getCreateForm to add fields.As soon as I add any fields, using the Formbuilder on this function, the automated permalink disappemulti select selected optionsI'm using the multi select as documented in https://twill.io/docs/form-fields/multi-select.html#mult[3.0.0-rc4] - How to show current value in a select form fieldCurrently I have my select field defined as: `@formField('select', [ 'name' => 'work_year', [3.0.0-rc4] Images not found on remote server - League\\Glide\\Filesystem\\FileNotFoundExceptionI just went from my local to my remote server and some images are showing up others are getting a 5[Twill2] Do settings section support media and how?As title says, is it possible to inject media here or should I make a custom settings singleton to h[3.x.dev] Call to undefined method ReflectionUnionType::getName()Newbie to Twill here. Fresh install of Laravel 10.4.1 / PHP 8.2.4 / MYSQL 8.0.32 on Ubuntu Budgie 2Add custom icons into twillI add the icons into the path `resource/views/admin/icons` and I run the command, result is ok, but Select an another block in a block?Hi everyone, I have a function to create a new block with name "Columns block". With this block, usMedia Library / Glide only loading JPEGsHey there, So I had a Laravel/Twill app running successfully on a subdomain with no issue. Today IAdding a vue componentGood afternoon Tell me what could be the problem? On the main page of the admin panel there is an aSave title in translationsI'm trying to save my title as a translatable field, normal fied works fine but when i make it transSet translations to activeWhile trying to set translations to active it isn't saved to database? Only english is selectable