CMS Blog with Shield Roles and Permissions

Filament 3
Also available in Filament 4/5 version

Roles and Permissions are really common. The Filament ecosystem has a few options for how to do them. This example showcases the Shield plugin.

FilamentExamples ThumbBase (34)

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for CMS Blog with Shield Roles and Permissions
Downloadable ZIP file with the source code
Lifetime access to this example
GitHub Sign in with GitHub to buy

Sign in first, then complete your $9 checkout.

Best value — all 169 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 169 examples
Future new examples and updates included
FilaCheck Pro package licence included
MCP server included
View membership plans

30-day money-back guarantee

How it works

This example is based on the CMS Blog system.

All roles are created, and permissions are granted using the UI of the Filament Shield plugin.

The Post Resource must have additional publish_post permission. To add such additional permissions, the Resource must implement the HasShieldPermissions interface. Then, in the getPermissionPrefixes(), provide all the policies.

app/Filament/Resources/PostResource.php:

use BezhanSalleh\FilamentShield\Contracts\HasShieldPermissions;
 
class PostResource extends Resource implements HasShieldPermissions
{
// ...
 
public static function getPermissionPrefixes(): array
{
return [
'view',
'view_any',
'create',
'update',
'delete',
'delete_any',
'publish',
];
}
}
The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.