@@ -346,6 +346,8 @@ export default class ApiKeysIndexController extends Controller {
346346
347347 this . modalsManager . show ( 'modals/rename-api-key-form' , {
348348 title : this . intl . t ( 'developers.api-keys.index.rename-api-key-title' , { apiKeyName } ) ,
349+ acceptButtonDisabled : this . abilities . cannot ( formPermission ) ,
350+ acceptButtonHelpText : this . abilities . cannot ( formPermission ) ? this . intl . t ( 'common.unauthorized' ) : null ,
349351 apiKey,
350352 formPermission,
351353 confirm : async modal => {
@@ -411,19 +413,23 @@ export default class ApiKeysIndexController extends Controller {
411413 * @void
412414 */
413415 @action rollApiKey ( apiKey ) {
416+ const formPermission = 'developers roll api-key' ;
414417 const apiKeyName = getWithDefault ( apiKey , 'name' , this . intl . t ( 'developers.api-keys.index.untitled' ) ) ;
415418
416419 this . modalsManager . show ( 'modals/roll-api-key-form' , {
417420 title : this . intl . t ( 'developers.api-keys.index.roll-api-key' , { apiKeyName } ) ,
418421 modalClass : 'roll-key-modal' ,
419422 acceptButtonText : this . intl . t ( 'developers.api-keys.index.roll-api-key-button-text' ) ,
423+ acceptButtonDisabled : this . abilities . cannot ( formPermission ) ,
424+ acceptButtonHelpText : this . abilities . cannot ( formPermission ) ? this . intl . t ( 'common.unauthorized' ) : null ,
420425 user : this . currentUser . user ,
421426 expirationOptions : this . expirationOptions ,
422427 setExpiration : ( { target } ) => {
423428 apiKey . expires_at = target . value || null ;
424429 } ,
425430 viewRequestLogs : this . viewRequestLogs ,
426431 password : null ,
432+ formPermission,
427433 apiKey,
428434 confirm : async modal => {
429435 modal . startLoading ( ) ;
0 commit comments