Skip to content

Commit

Permalink
Merge pull request #961 from PasanT9/design-fix
Browse files Browse the repository at this point in the history
Make API Design Assitant only availalbe to users with apim:api_create scope
  • Loading branch information
PasanT9 authored Mar 1, 2025
2 parents 7b008b4 + a6411d5 commit 2a93427
Showing 1 changed file with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,24 +193,25 @@ function TopMenu(props) {
</APICreateMenu>
)}
{/* Button to Create API with AI */}
<Button
variant='contained'
color='primary'
component={Link}
disabled={isRestricted(['apim:api_publish', 'apim:api_create'])}
to='/apis/design-assistant'
sx={{ marginLeft: '10px' }}
>
<FormattedMessage
id='Apis.Listing.components.TopMenu.create.api.with.ai'
defaultMessage='Create API with AI'
/>
<img
alt='API Design Assistant'
src={`${app.context}/site/public/images/ai/DesignAssistant.svg`}
style={{ marginLeft: 8, width: 15, height: 15 }}
/>
</Button>
{!query && !isAPIProduct && !isRestricted(['apim:api_create']) && (
<Button
variant='contained'
color='primary'
component={Link}
to='/apis/design-assistant'
sx={{ marginLeft: '10px' }}
>
<FormattedMessage
id='Apis.Listing.components.TopMenu.create.api.with.ai'
defaultMessage='Create API with AI'
/>
<img
alt='API Design Assistant'
src={`${app.context}/site/public/images/ai/DesignAssistant.svg`}
style={{ marginLeft: 8, width: 15, height: 15 }}
/>
</Button>
)}
</div>
{showToggle && (
<Box height={32} m='auto' mr={8}>
Expand Down

0 comments on commit 2a93427

Please sign in to comment.