Skip to content

Commit

Permalink
Use 'set_configuration_threshold' for set config access check
Browse files Browse the repository at this point in the history
Fixes #32258
  • Loading branch information
vboctor committed Apr 9, 2023
1 parent 4d0036a commit da8d235
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/commands/ConfigsSetCommand.php
Expand Up @@ -48,12 +48,14 @@ function __construct( array $p_data ) {

/**
* Validate the data.
*
* @return void
*/
function validate() {
$t_current_user_id = auth_get_current_user_id();

// verify that user has administrator access
$t_access_level_required = config_get_global( 'admin_site_threshold' );
// verify that user has appropriate access level to set configuration via database
$t_access_level_required = config_get_global( 'set_configuration_threshold' );
if( !access_has_global_level( $t_access_level_required, $t_current_user_id ) ) {
throw new ClientException(
"User doesn't have access to set configs.",
Expand Down

0 comments on commit da8d235

Please sign in to comment.