You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 29, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,9 @@ public function panel(Panel $panel): Panel
56
56
}
57
57
```
58
58
## Authorization
59
-
To enforce policies on `ActivityResource`, after generating a policy, you would need to register `Spatie\Activitylog\Models\Activity` to use that policy in the AuthServiceProvider.
59
+
`ActivityResource` now uses strict authorization by default. If there is no registered policy, or the policy does not implement `viewAny` / `view`, the log resource is denied instead of falling back to Filament's permissive default.
60
+
61
+
After generating a policy, register `Spatie\Activitylog\Models\Activity` to use that policy in the AuthServiceProvider.
60
62
```php
61
63
<?php
62
64
@@ -77,6 +79,40 @@ class AuthServiceProvider extends ServiceProvider
77
79
```
78
80
> If you are using [Shield](https://filamentphp.com/plugins/shield) just register the ActivityPolicy generated by it
79
81
82
+
If you need the previous behavior for a legacy install, you can disable strict policy enforcement:
83
+
84
+
```php
85
+
'authorization' => [
86
+
'strict' => false,
87
+
],
88
+
```
89
+
90
+
## Security defaults
91
+
This package now applies a few safer defaults out of the box:
92
+
93
+
-`ActivityResource` requires explicit policy methods when `authorization.strict` is enabled.
94
+
- Sensitive keys such as passwords, tokens, secrets, and recovery codes are redacted before being stored in activity properties.
95
+
- Access logs anonymize IP addresses and trim user agents by default.
96
+
- Notification recipients are not logged unless `notifications.log_recipient` is explicitly enabled.
0 commit comments