This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 2 files changed +23
-10
lines changed
2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ export const PERMISSIONS = {
80
80
/**
81
81
* Job
82
82
*/
83
+ UPDATE_JOB_NOT_OWN : {
84
+ meta : {
85
+ group : "Job" ,
86
+ title : "Edit Job (not own)" ,
87
+ description : "Who can edit job created by some other user." ,
88
+ } ,
89
+ topcoderRoles : [ TOPCODER_ROLE . BOOKING_MANAGER , TOPCODER_ROLE . ADMINISTRATOR ] ,
90
+ } ,
91
+
83
92
UPDATE_JOB_STATUS : {
84
93
meta : {
85
94
group : "Job" ,
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ import IconOpenings from "../../assets/images/icon-openings.svg";
22
22
import Button from "../../components/Button" ;
23
23
import { formatDate } from "utils/format" ;
24
24
import "./styles.module.scss" ;
25
+ import { hasPermission } from "utils/permissions" ;
26
+ import { PERMISSIONS } from "constants/permissions" ;
25
27
26
28
const JobDetails = ( { teamId, jobId } ) => {
27
29
const [ job , loadingError ] = useData ( getJobById , jobId ) ;
@@ -95,16 +97,18 @@ const JobDetails = ({ teamId, jobId }) => {
95
97
{ job . status }
96
98
</ DataItem >
97
99
</ div >
98
- < div styleName = "actions" >
99
- < Button
100
- target = "_blank"
101
- size = "medium"
102
- className = "editButton"
103
- routeTo = { `/taas/myteams/${ teamId } /positions/${ job . id } /edit` }
104
- >
105
- Edit Job Details
106
- </ Button >
107
- </ div >
100
+ { hasPermission ( PERMISSIONS . UPDATE_JOB_NOT_OWN ) && (
101
+ < div styleName = "actions" >
102
+ < Button
103
+ target = "_blank"
104
+ size = "medium"
105
+ className = "editButton"
106
+ routeTo = { `/taas/myteams/${ teamId } /positions/${ job . id } /edit` }
107
+ >
108
+ Edit Job Details
109
+ </ Button >
110
+ </ div >
111
+ ) }
108
112
</ div >
109
113
</ >
110
114
) }
You can’t perform that action at this time.
0 commit comments