Skip to content

Commit

Permalink
Just reuse work_package/read capability
Browse files Browse the repository at this point in the history
Managing reminders is based on the `view_work_packages` permission
which is already indentified via `work_packages/read` capability.
It would be redundant to introduce a new capability name
  • Loading branch information
akabiru committed Jan 20, 2025
1 parent e0e13e4 commit 89a570f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions config/initializers/permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@
"work_packages/reminders": %i[modal_body create update destroy]
},
permissible_on: %i[work_package project],
contract_actions: { work_packages: %i[read],
work_package_reminders: %i[manage] }
contract_actions: { work_packages: %i[read] }

wpt.permission :add_work_packages,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class WorkPackageSplitViewToolbarComponent implements OnInit {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
this.displayShareButton$ = this.currentUserService.hasCapabilities$('work_package_shares/index', this.workPackage.project.id);
this.displayReminderButton$ = this.currentUserService.isLoggedInAndHasCapabalities$(
'work_package_reminders/manage',
'work_packages/read',
(this.workPackage.project as ProjectResource).id,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class WorkPackagesFullViewComponent extends WorkPackageSingleViewBase imp
this.displayTimerButton = Object.prototype.hasOwnProperty.call(wp, 'logTime');
this.displayShareButton$ = this.currentUserService.hasCapabilities$('work_package_shares/index', (wp.project as ProjectResource).id);
this.displayReminderButton$ = this.currentUserService.isLoggedInAndHasCapabalities$(
'work_package_reminders/manage',
'work_packages/read',
(this.workPackage.project as ProjectResource).id,
);

Expand Down

0 comments on commit 89a570f

Please sign in to comment.