File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All Notable changes to ` laravel-permission ` will be documented in this file
4
4
5
+ ## 1.3.1 - 2016-01-10
6
+
7
+ - fixed bug when testing for non existing permissions
8
+
5
9
## 1.3.0 - 2015-12-25
6
10
7
11
- added compatiblity for Laravel 5.2
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public function hasRole($roles)
77
77
return $ this ->roles ->contains ('id ' , $ roles ->id );
78
78
}
79
79
80
- return (bool ) !! $ roles ->intersect ($ this ->roles )->count ();
80
+ return (bool ) ( bool ) $ roles ->intersect ($ this ->roles )->count ();
81
81
}
82
82
83
83
/**
@@ -169,6 +169,10 @@ protected function hasDirectPermission(Permission $permission)
169
169
{
170
170
if (is_string ($ permission )) {
171
171
$ permission = app (Permission::class)->findByName ($ permission );
172
+
173
+ if (!$ permission ) {
174
+ return false ;
175
+ }
172
176
}
173
177
174
178
return $ this ->permissions ->contains ('id ' , $ permission ->id );
You can’t perform that action at this time.
0 commit comments