mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 18:12:05 +08:00
Disable editing routines if user has no privilege to select from mysql.proc or if he's not the owner of that routine. See http://www.heidisql.com/forum.php?t=10231
This commit is contained in:
@ -17,6 +17,15 @@ object frmRoutineEditor: TfrmRoutineEditor
|
|||||||
Caption = 'Routine body:'
|
Caption = 'Routine body:'
|
||||||
FocusControl = SynMemoBody
|
FocusControl = SynMemoBody
|
||||||
end
|
end
|
||||||
|
object lblDisabledWhy: TLabel
|
||||||
|
Left = 256
|
||||||
|
Top = 460
|
||||||
|
Width = 177
|
||||||
|
Height = 13
|
||||||
|
Anchors = [akLeft, akBottom]
|
||||||
|
Caption = 'You have no privilege to this routine.'
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
object btnSave: TButton
|
object btnSave: TButton
|
||||||
Left = 165
|
Left = 165
|
||||||
Top = 455
|
Top = 455
|
||||||
|
@ -43,6 +43,7 @@ type
|
|||||||
comboDefiner: TComboBox;
|
comboDefiner: TComboBox;
|
||||||
btnMoveUpParam: TToolButton;
|
btnMoveUpParam: TToolButton;
|
||||||
btnMoveDownParam: TToolButton;
|
btnMoveDownParam: TToolButton;
|
||||||
|
lblDisabledWhy: TLabel;
|
||||||
procedure comboTypeSelect(Sender: TObject);
|
procedure comboTypeSelect(Sender: TObject);
|
||||||
procedure btnSaveClick(Sender: TObject);
|
procedure btnSaveClick(Sender: TObject);
|
||||||
procedure btnHelpClick(Sender: TObject);
|
procedure btnHelpClick(Sender: TObject);
|
||||||
@ -166,6 +167,11 @@ begin
|
|||||||
editComment.Text := Comment;
|
editComment.Text := Comment;
|
||||||
comboDefiner.Text := Definer;
|
comboDefiner.Text := Definer;
|
||||||
SynMemoBody.Text := Body;
|
SynMemoBody.Text := Body;
|
||||||
|
// User may not be allowed to view code in SHOW CREATE FUNCTION, in which case we have an empty CreateCode.
|
||||||
|
// Disable editor in this case.
|
||||||
|
lblDisabledWhy.Visible := Body = '';
|
||||||
|
PageControlMain.Enabled := not lblDisabledWhy.Visible;
|
||||||
|
SynMemoBody.Enabled := PageControlMain.Enabled;
|
||||||
end else begin
|
end else begin
|
||||||
editName.Text := '';
|
editName.Text := '';
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user