@@ -8,7 +8,7 @@ import { TaskItemsApiClient } from '../../../../core/api/clients/task-items-api.
88import { ProjectDto } from '../../../../core/api/models/project.model' ;
99import { TaskItemDto } from '../../../../core/api/models/task-item.model' ;
1010import { TaskStatus } from '../../../../core/api/models/task-status.enum' ;
11- import { MANAGEMENT_ROLES } from '../../../../core/auth/models/app-role.model' ;
11+ import { AppRole , MANAGEMENT_ROLES } from '../../../../core/auth/models/app-role.model' ;
1212import { AuthService } from '../../../../core/auth/services/auth.service' ;
1313import { APP_ENVIRONMENT } from '../../../../core/config/app-environment.token' ;
1414import { AppPreferencesService } from '../../../../core/preferences/app-preferences.service' ;
@@ -124,6 +124,10 @@ export class TaskItemListComponent implements OnInit, OnDestroy {
124124 return this . authService . hasAnyRole ( [ ...MANAGEMENT_ROLES ] ) ;
125125 }
126126
127+ get canSelfAssignTasks ( ) : boolean {
128+ return this . authService . hasRole ( AppRole . User ) ;
129+ }
130+
127131 get defaultTablePageSize ( ) : number {
128132 return this . preferencesService . preferences ( ) . defaultTablePageSize ;
129133 }
@@ -243,7 +247,7 @@ export class TaskItemListComponent implements OnInit, OnDestroy {
243247
244248 assignToMe ( task : TaskItemDto ) : void {
245249 const userId = this . currentUserId ;
246- if ( ! userId || this . isTaskPending ( task . id ) || ! this . isUnassigned ( task ) ) {
250+ if ( ! this . canSelfAssignTasks || ! userId || this . isTaskPending ( task . id ) || ! this . isUnassigned ( task ) ) {
247251 return ;
248252 }
249253
0 commit comments