Conversation
…arlier commits is probably not working correctly
…advanced_search_predefined_filters
…for custom field queries
…om:imbus/snipe-it into feature/advanced_search_predefined_filters
…ed_filters' into systemtests
|
|
||
| on: | ||
| push: | ||
| branches: ['develope, master'] |
|
|
||
| $table->unsignedBigInteger('permission_group_id'); | ||
| $table->unsignedInteger('created_by'); | ||
| $table->timestamps(); |
There was a problem hiding this comment.
I don't know if the should keep the timestamps in the predefined_filter_permissions table. If we remove it public $timestamps = false; needs to be added in the model.
| ), | ||
|
|
||
| 'create' => array( | ||
| 'not_allowed' => "Du hast nicht die Berechtigungen um diesen Filter zu erstellen", |
There was a problem hiding this comment.
I think this version for Germany is with Sie
|
|
||
| /** | ||
| * Categories API routes | ||
| * Categpries API routes |
| $user = auth()->user(); | ||
| $validated = $request->validate((new PredefinedFilter)->getRules()); | ||
|
|
||
| if (!empty($validated['is_public']) && !$user->hasAccess('predefinedFilter.create')) { |
There was a problem hiding this comment.
$user-> hasAccess() vs $filter-> userHasPermission()
| return (new SelectlistTransformer)->transformSelectlist($filters); | ||
| } | ||
|
|
||
| // Optional: You can refactor the permission syncing methods similarly |
| $permission = $this->service->store($validated); | ||
|
|
||
| return response()->json([ | ||
| 'message' => __('admin/reports/message.create.success'), |
There was a problem hiding this comment.
this has to be "'message' => trans('admin[...]')
| $this->service->delete($id); | ||
|
|
||
| return response()->json([ | ||
| 'message' => __('admin/reports/message.delete.success'), |
| ->get(); | ||
|
|
||
| return view('hardware/index')->with('company', $company); | ||
| return view('hardware/index')->with('company', $company)->with('predefined_filters', $predefined_filters); // TODO maybe switch later to user / role based view |
|
|
||
| public function test_index_unauthenticated_gets_302() | ||
| { | ||
| $this->getJson('api/v1/predefinedFilters')->assertStatus(302); |
There was a problem hiding this comment.
routes are now predefined-filters
| ->assertOk(); | ||
| } | ||
| } | ||
| } No newline at end of file |
| $currently_set_permssions = $this->predefinedFilterPermissionService->getPermissionsById($filter->id); | ||
| $new_permissions = $validated['permissions']; | ||
| $permission_diff = $this->syncPermissions($currently_set_permssions->toArray(), $new_permissions); | ||
| //dump($permission_diff); |
| DB::transaction(function () use ($permission_diff, $filter) { | ||
| if (!empty($permission_diff['to_delete'])) { | ||
| foreach ($permission_diff['to_delete'] as $permission) { | ||
| //dump($permission); |
| if (!empty($permission_diff['to_add'])) { | ||
| foreach ($permission_diff['to_add'] as $permission) { | ||
| $permission['predefined_filter_id'] = $filter->id; | ||
| //dump($permission); |
| $this->authorize('index', Asset::class); | ||
| $company = Company::find($request->input('company_id')); | ||
| // $predefined_filters = PredefinedFilter::Auth(); | ||
| // $predefined_filters = PredefinedFilter::orderBy('name')->get(); |
There was a problem hiding this comment.
here is some commented-out code
| /** | ||
| * PredefinedFilter API routes | ||
| */ | ||
| //Route::middleware('auth:api')->group(function () { |
There was a problem hiding this comment.
Here is the route still commented out.
Klausw-1
left a comment
There was a problem hiding this comment.
Review was conducted and changes commented on.
No description provided.