Skip to content

Commit 0027e94

Browse files
committed
Fixed missing team owner role
1 parent cffcbc5 commit 0027e94

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
### Fixed
2222
### Removed --->
2323

24-
## 0.6.7 - 2021-09-11
24+
## 0.6.8 - 2021-09-12
25+
### Fixed
26+
- Roles & Permissions team owner role missing
27+
28+
## 0.6.7 - 2021-09-12
2529
### Added
2630
- Roles & Permissions team support
2731

config/package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
|
1414
*/
1515

16-
'version' => '0.6.7',
16+
'version' => '0.6.8',
1717

1818
];

src/Http/Middleware/HasCrmAccess.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ public function handle($request, Closure $next)
2626
if (! config('laravel-crm.teams') && config('laravel-crm.crm_owner') == auth()->user()->email && (! auth()->user()->hasRole('Owner') || ! auth()->user()->hasCrmAccess())) {
2727
auth()->user()->assignRole('Owner');
2828

29+
auth()->user()->forceFill([
30+
'crm_access' => 1,
31+
])->save();
32+
} elseif (config('laravel-crm.teams') && auth()->user()->currentTeam->user_id == auth()->user()->id && ! auth()->user()->hasRole('Owner')) {
33+
auth()->user()->assignRole('Owner');
34+
2935
auth()->user()->forceFill([
3036
'crm_access' => 1,
3137
])->save();

0 commit comments

Comments
 (0)