Skip to content

Commit 6ea8075

Browse files
committed
fix CR notes
1 parent 9e910ab commit 6ea8075

3 files changed

Lines changed: 0 additions & 67 deletions

File tree

ProcessMaker/Providers/PermissionServiceProvider.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,4 @@ public function register(): void
2828
);
2929
});
3030
}
31-
32-
/**
33-
* Bootstrap services.
34-
*/
35-
public function boot(): void
36-
{
37-
// Publish configuration if needed
38-
// $this->publishes([
39-
// __DIR__.'/../config/permissions.php' => config_path('permissions.php'),
40-
// ], 'permissions');
41-
}
4231
}

ProcessMaker/Repositories/PermissionRepository.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -180,31 +180,6 @@ public function getNestedGroupPermissions(int $groupId): array
180180
return array_unique($permissions);
181181
}
182182

183-
/**
184-
* Add category view permissions based on create/edit permissions
185-
*/
186-
private function addCategoryViewPermissions(array $permissions): array
187-
{
188-
$addFor = [
189-
'processes' => 'view-process-categories',
190-
'scripts' => 'view-script-categories',
191-
'screens' => 'view-screen-categories',
192-
];
193-
194-
foreach ($addFor as $resource => $categoryPermission) {
195-
if (
196-
in_array('create-' . $resource, $permissions) ||
197-
in_array('edit-' . $resource, $permissions)
198-
) {
199-
if (!in_array($categoryPermission, $permissions)) {
200-
$permissions[] = $categoryPermission;
201-
}
202-
}
203-
}
204-
205-
return $permissions;
206-
}
207-
208183
/**
209184
* Get nested group permissions recursively with protection against infinite loops
210185
*/

ProcessMaker/Traits/HasAuthorization.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ private function getPermissionService(): PermissionServiceManager
2626

2727
public function loadPermissions()
2828
{
29-
// return array_merge(
30-
// $this->loadUserPermissions(),
31-
// $this->loadGroupPermissions()
32-
// );
33-
3429
// Use the new optimized service
3530
return $this->getPermissionService()->getUserPermissions($this->id);
3631
}
@@ -92,36 +87,10 @@ public function loadPermissionOfGroups(Group $group, array $permissions = [], ar
9287

9388
public function hasPermission($permissionString)
9489
{
95-
// $permissionStrings = $this->loadPermissions();
96-
// return in_array($permissionString, $permissionStrings);
9790
// Use the new optimized service for permission checking
9891
return $this->getPermissionService()->userHasPermission($this->id, $permissionString);
9992
}
10093

101-
/**
102-
* Check if user has any of the given permissions
103-
*/
104-
// public function hasAnyPermission(array $permissions): bool
105-
// {
106-
// return $this->getPermissionService()->userHasAnyPermission($this->id, $permissions);
107-
// }
108-
109-
/**
110-
* Check if user has all of the given permissions
111-
*/
112-
// public function hasAllPermissions(array $permissions): bool
113-
// {
114-
// return $this->getPermissionService()->userHasAllPermissions($this->id, $permissions);
115-
// }
116-
117-
/**
118-
* Warm up permission cache for this user
119-
*/
120-
// public function warmUpPermissionCache(): void
121-
// {
122-
// $this->getPermissionService()->warmUpUserCache($this->id);
123-
// }
124-
12594
/**
12695
* Invalidate permission cache for this user
12796
*/

0 commit comments

Comments
 (0)