File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ Enhancement: Hide the "Remove Password" button on public links
2+
3+ This change hides the "Remove Password" button when editing a
4+ public link if a password in mandatory.
5+
6+ https://github.com/owncloud/core/pull/39302
7+ https://github.com/owncloud/core/issues/35684
Original file line number Diff line number Diff line change 366366 } )
367367 }
368368
369- if ( this . model . get ( 'encryptedPassword' ) ) {
369+ if ( this . model . get ( 'encryptedPassword' ) && ! this . linkPasswordRequired ( ) ) {
370370 buttons . push ( {
371371 classes : 'removePassword' ,
372372 text : t ( 'core' , 'Remove password' ) ,
391391 self . $dialog . html ( self . $el ) ;
392392 self . $el . find ( 'input:first' ) . focus ( ) ;
393393 } ) ;
394+ } ,
395+
396+ linkPasswordRequired : function ( ) {
397+ if ( this . model . get ( 'permissions' ) === OC . PERMISSION_CREATE ) {
398+ return oc_appconfig . core . enforceLinkPasswordWriteOnly ;
399+ }
400+
401+ if ( this . model . get ( 'permissions' ) === OC . PERMISSION_READ ) {
402+ return oc_appconfig . core . enforceLinkPasswordReadOnly ;
403+ }
404+
405+ if ( this . model . get ( 'permissions' ) === ( OC . PERMISSION_READ | OC . PERMISSION_CREATE ) ) {
406+ return oc_appconfig . core . enforceLinkPasswordReadWrite ;
407+ }
408+
409+ if ( this . model . get ( 'permissions' ) >= ( OC . PERMISSION_READ | OC . PERMISSION_UPDATE | OC . PERMISSION_CREATE | OC . PERMISSION_DELETE ) ) {
410+ return oc_appconfig . core . enforceLinkPasswordReadWriteDelete ;
411+ }
394412 }
395413
396414} ) ;
You can’t perform that action at this time.
0 commit comments