Skip to content

Commit

Permalink
use config to determine publish permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
shayanaijaz committed Nov 25, 2024
1 parent 859baf1 commit dcc3967
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const SubmitPublicationReview = ({ callbackUrl }) => {

const history = useHistory();

const [submitDisabled, setSubmitDisabled] = useState(true);
const [submitDisabled, setSubmitDisabled] = useState(false);

const { debug } = useSelector((state) => state.workbench.config);
const { canPublish = false } = useSelector((state) => state.workbench.config) || {};

const {
isApproveLoading,
Expand Down Expand Up @@ -85,7 +85,7 @@ const SubmitPublicationReview = ({ callbackUrl }) => {
<Button
type="primary"
className={styles['submit-button']}
disabled={submitDisabled}
disabled={submitDisabled || !canPublish}
isLoading={isApproveLoading}
onClick={handleApproveAndPublish}
>
Expand Down
1 change: 1 addition & 0 deletions server/portal/settings/settings_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"""
_WORKBENCH_SETTINGS = {
"debug": _DEBUG,
"canPublish": True,
"makeLink": False,
"viewPath": True,
"compressApp": 'compress',
Expand Down

0 comments on commit dcc3967

Please sign in to comment.