#NEWLINE# @ access . admin #NEWLINE# @ describeRoute ( Description ( 'Set the list of enabled plugins for the system.' ) . responseClass ( 'Setting' ) . notes ( 'Must be a system administrator to call this.' ) . param ( 'plugins' , 'JSON array of plugins to enable.' ) . errorResponse ( 'Required dependencies do not exist.' , 500 ) . errorResponse ( 'You are not a system administrator.' , 403 ) ) #NEWLINE# def enablePlugins( self , params ) : #NEWLINE# #INDENT# self . requireParams ( 'plugins' , params ) #NEWLINE# try : #NEWLINE# #INDENT# plugins = json . loads ( params [ 'plugins' ] ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise RestException ( 'Plugins parameter should be a JSON list.' ) #NEWLINE# #UNINDENT# return self . model ( 'setting' ) . set ( SettingKey . PLUGINS_ENABLED , plugins )