Releases: tpg/deadbolt
v2.2.5
v2.2.4
Added some syntactic sugar with a has
method on the UserCollection
class. It's really just an alias for anyHave
.
v2.2.3
Added a describe
method to the User
class.
v2.2.2
Support for versions of Laravel > 8.
v2.2.1
Updated dependencies to get round a vulnerability in nanoid versions less than 3.1.31. Nanoid is a dependency of Mocha which is used for testing the simple JavaScript component we added.
Other dependencies have been upgraded as well.
v2.2.0
This only updates there JavaScript library. Just a little more logical, I think.
- Slight breaking change in the JavaScript helper. The constructor will now only accept a permissions array or JSON encoded string.
- You don't need to pass a whole user object into the
Deadbolt()
constructor.
v2.1.0
This release includes something a little different. Deadbolt was initially started so I could easily test permissions in a JavaScript front-end. That requirement hasn't really changed, so I've added a simple JavaScript class which can be used to test for permissions on the front-end.
It's really simple and doesn't do anything magical, but it's handy and means you don't have to do this yourself.
You can use it like this:
import Deadbolt from '../../vendor/thepublicgood/deadbolt/dist/Deadbolt.js';
const permissions = new Deadbolt(user); // the `user` object from your laravel app.
const can = permissions.has('articles.create');
There's more info in the README.
This release also includes some clean-ups around the tests and a bug that pops up when using the HasPermissions
trait.
v2.0.2
v2.0.1
v2.0.0
Version 2 makes a fairly large breaking change.
- The entire groups system has been removed. Deadbolt is supposed to be simple, but groups makes it more complex than it needs to be. If you still need groups, you'll need to implement something yourself. Deadbolt is a permissions library, and that's it.
- A new
HasPermissions
trait has been added providing a whole new way to work with permissions and users. - There's no longer a need to call the save() method. Permissions are persistent by default now.
- Minimum PHP version is now 7.3 to match Laravel 7 framework requirement.