diff --git a/Database/1 - tablas.sql b/Database/1 - tablas.sql
index a0ba77f..81e6e33 100644
--- a/Database/1 - tablas.sql
+++ b/Database/1 - tablas.sql
@@ -948,7 +948,6 @@ GO
CREATE TABLE [RDX_PERMISOS] (
- [ID] INT NOT NULL,
[ID_USUARIO] INT,
[MODULO] VARCHAR(50),
[NOMBRECOMP] VARCHAR(50),
@@ -956,21 +955,12 @@ CREATE TABLE [RDX_PERMISOS] (
)
GO
-ALTER TABLE [RDX_PERMISOS]
-ADD CONSTRAINT [RDX_PERMISOS_PK]
-PRIMARY KEY CLUSTERED ([ID])
-ON [PRIMARY]
-GO
-
-
-
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[RDX_PERMISOSEX]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [RDX_PERMISOSEX]
GO
CREATE TABLE [RDX_PERMISOSEX] (
- [ID] INT NOT NULL,
[ID_USUARIO] INT,
[MODULO] VARCHAR(50),
[NOMBRECOMP] VARCHAR(50),
@@ -979,12 +969,6 @@ CREATE TABLE [RDX_PERMISOSEX] (
)
GO
-ALTER TABLE [RDX_PERMISOSEX]
-ADD CONSTRAINT [RDX_PERMISOSEX_PK]
-PRIMARY KEY CLUSTERED ([ID])
-ON [PRIMARY]
-GO
-
/* EOF */
diff --git a/Source/ApplicationBase/ApplicationBase.dpk b/Source/ApplicationBase/ApplicationBase.dpk
index e76f2a2..b1a9348 100644
--- a/Source/ApplicationBase/ApplicationBase.dpk
+++ b/Source/ApplicationBase/ApplicationBase.dpk
@@ -58,6 +58,7 @@ contains
uViewUsuario in 'Usuarios\Views\uViewUsuario.pas' {frViewUsuario: TFrame},
uEditorCambiarPassword in 'Usuarios\Views\uEditorCambiarPassword.pas' {fEditorCambiarPassword},
schUsuariosClient_Intf in 'Usuarios\Model\schUsuariosClient_Intf.pas',
- schUsuariosServer_Intf in 'Usuarios\Model\schUsuariosServer_Intf.pas';
+ schUsuariosServer_Intf in 'Usuarios\Model\schUsuariosServer_Intf.pas',
+ uEditorPermisosUsuario in 'Usuarios\Views\uEditorPermisosUsuario.pas' {fEditorPermisosUsuario};
end.
diff --git a/Source/ApplicationBase/ApplicationBase.dproj b/Source/ApplicationBase/ApplicationBase.dproj
index 64b496a..a40078f 100644
--- a/Source/ApplicationBase/ApplicationBase.dproj
+++ b/Source/ApplicationBase/ApplicationBase.dproj
@@ -46,13 +46,6 @@
Package
FalseTrueFalseTrueFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0
-
-
-
-
-
-
-
VCL for the Web Design Package for CodeGear RAD Studio
CodeGear WebSnap Components
CodeGear SOAP Components
@@ -67,19 +60,13 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -120,6 +107,9 @@
+
+
+
TFrame
diff --git a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas
index 60353c2..a97db96 100644
--- a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas
+++ b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas
@@ -11,7 +11,7 @@ type
TUCCriptografia = (ucStandard, ucMD5);
IUsuariosController = interface(IControllerBase)
- ['{DD963EEC-5880-4DE7-AF55-B5080B538D84}']
+ ['{0A637F24-4243-45B7-9FCA-A2540F39453F}']
procedure Logoff;
function StartLogin : Boolean;
@@ -22,7 +22,7 @@ type
procedure VerPerfil(const AIDPerfil: Integer); overload;
procedure VerPerfil(APerfil : IBizPerfilUsuario); overload;
-
+
procedure _ShowUserManager;
procedure _ShowProfileManager;
procedure _ShowLogManager;
@@ -40,6 +40,10 @@ type
function GuardarPerfil(APerfil : IBizPerfilUsuario): Boolean;
function GuardarUsuario(AUser : IBizUsuario): Boolean;
+ function AdministrarAccesos(AUser : IBizUsuario): Boolean;
+
+ function HayAccesoPermitido(const AActionName: String): Boolean;
+
function EliminarUsuario(const AIDUser : integer): Boolean; overload;
function EliminarUsuario(AUser : IBizUsuario): Boolean; overload;
@@ -47,6 +51,7 @@ type
function EliminarPerfil(const AIDPerfil : integer): Boolean; overload;
function HayUsuarioConPerfil(const AIDPerfil : integer): Boolean;
+ function EsAdministrador(AUser : IBizUsuario): Boolean;
function BuscarUsuario(const AIDUser: Integer): IBizUsuario;
function BuscarTodosUsuarios: IBizUsuario;
@@ -63,6 +68,9 @@ type
function GetCriptografia : TUCCriptografia;
property Criptografia: TUCCriptografia read GetCriptografia;
+ function GetUserControl : TUserControl;
+ property UserControl: TUserControl read GetUserControl;
+
function GetUsarPasswordsSeguras: Boolean;
procedure SetUsarPasswordsSeguras(const Value: Boolean);
property UsarPasswordsSeguras : Boolean read GetUsarPasswordsSeguras write SetUsarPasswordsSeguras;
@@ -120,6 +128,8 @@ type
function GetUsarPasswordsSeguras: Boolean;
procedure SetUsarPasswordsSeguras(const Value: Boolean);
+
+ function GetUserControl : TUserControl;
public
constructor Create; virtual;
destructor Destroy; override;
@@ -150,6 +160,12 @@ type
function GuardarPerfil(APerfil : IBizPerfilUsuario): Boolean;
function GuardarUsuario(AUser : IBizUsuario): Boolean;
+ function EsAdministrador(AUser : IBizUsuario): Boolean;
+
+ function AdministrarAccesos(AUser : IBizUsuario): Boolean;
+
+ function HayAccesoPermitido(const AActionName: String): Boolean;
+
function BuscarUsuario(const AIDUser: Integer): IBizUsuario;
function BuscarTodosUsuarios: IBizUsuario;
@@ -160,8 +176,9 @@ type
function ValidarPassword(const APassword : string; const ALogin : String;
const ANombre: String; out AMsg : String): boolean;
+ property UserControl: TUserControl read GetUserControl;
property UsarPasswordsSeguras : Boolean read GetUsarPasswordsSeguras write SetUsarPasswordsSeguras;
- property UserControl : TUserControl read FUserControl;
+ //property UserControl : TUserControl read FUserControl;
property MaxIntentosLogin : Integer read GetMaxIntentosLogin write SetMaxIntentosLogin;
property CurrentUser: IBizUsuario read GetCurrentUser;
property Criptografia: TUCCriptografia read GetCriptografia;
@@ -170,14 +187,111 @@ type
implementation
uses
- cxControls, DB, uEditorRegistryUtils, schUsuariosClient_Intf,
+ cxControls, Menus, DB, uEditorRegistryUtils, schUsuariosClient_Intf,
uDAInterfaces, uDataTableUtils, uDialogUtils, uAdminPV_App, Dialogs,
uDateUtils, uROTypes, DateUtils, Controls, Windows, uIEditorLogin,
uIEditorUsuarios, uIEditorUsuario, uIEditorPerfilesUsuario,
- uIEditorPerfilUsuario, uEditorCambiarPassword;
+ uIEditorPerfilUsuario, uEditorCambiarPassword, uEditorPermisosUsuario;
{ TUsuariosController }
+function TUsuariosController.AdministrarAccesos(AUser: IBizUsuario): Boolean;
+var
+ AEditorPermisos : TfEditorPermisosUsuario;
+
+ function EsUnModulo(AMenuItem : TMenuItem) : Boolean;
+ begin
+ Result := (AMenuItem.Tag >= 0) and (AMenuItem.Tag < 9000)
+ end;
+
+ procedure ExtraerPermisos;
+ var
+ AItemIndex, ASeccionCount : Integer;
+ AMenuItem : TMenuItem;
+ TempCampos, TempCamposEX: String;
+ i : Integer;
+ begin
+ with FUserControl do
+ begin
+ TempCampos := Format(' %s as IdUser, %s as Modulo, %s as ObjName, %s as UCKey ',
+ [TableRights.FieldUserID,
+ TableRights.FieldModule,
+ TableRights.FieldComponentName,
+ TableRights.FieldKey]);
+ TempCamposEX := Format('%s, %s as FormName ', [TempCampos, TableRights.FieldFormName]);
+
+ AEditorPermisos.DSPermiss := DataConnector.UCGetSQLDataset(Format('Select %s from %s tab Where tab.%s = %s and tab.%s = %s',
+ [TempCampos,
+ TableRights.TableName,
+ TableRights.FieldUserID,
+ IntToStr(AUser.ID),
+ TableRights.FieldModule,
+ QuotedStr(ApplicationID)]));
+
+ AEditorPermisos.DSPermiss.Open;
+
+ AEditorPermisos.DSPermissEX := DataConnector.UCGetSQLDataset(Format('Select %s from %s tab1 Where tab1.%s = %s and tab1.%s = %s',
+ [TempCamposEX,
+ TableRights.TableName + 'EX',
+ TableRights.FieldUserID,
+ IntToStr(AUser.ID),
+ TableRights.FieldModule,
+ QuotedStr(ApplicationID)]));
+
+ AEditorPermisos.DSPermissEX.Open;
+
+ AEditorPermisos.DSPerfil := TDataset.Create(AEditorPermisos);
+
+ ExtraRights.BeginUpdate;
+ ExtraRights.Clear;
+ try
+ // Guardar la lista de secciones (Ventas, Compras, etc...)
+ for ASeccionCount := 0 to AppAdminPV.MainForm.Menu.Items.Count - 1 do
+ begin
+ AMenuItem := AppAdminPV.MainForm.Menu.Items[ASeccionCount];
+
+ if not EsUnModulo(AMenuItem) then
+ Continue;
+
+ for AItemIndex := 0 to (AMenuItem.Count - 1) do
+ begin
+ if ((not AMenuItem[AItemIndex].IsLine) // que no sea una línea separadora
+ and (AMenuItem[AItemIndex].Count = 0)) // y que no sea el padre de un submenú
+ then
+ with ExtraRights.Add do
+ begin
+ GroupName := StringReplace(AMenuItem.Caption, '&', '', []);
+ Caption := StringReplace(AMenuItem[AItemIndex].Caption, '&', '', []);
+ CompName := AMenuItem[AItemIndex].Action.Name;
+ FormName := StringReplace(AMenuItem[AItemIndex].Caption, '&', '', []);
+ end;
+ end;
+ end;
+ finally
+ ExtraRights.EndUpdate;
+ end;
+ end;
+ end;
+
+begin
+ if not Assigned(AUser) then
+ raise Exception.Create('No hay usuario asignado (AdministrarAccesos)');
+
+ AUser.Active := True;
+
+ AEditorPermisos := TfEditorPermisosUsuario.Create(NIL);
+ with AEditorPermisos do
+ try
+ FUser := AUser;
+ AEditorPermisos.FUserControl := Self.FUserControl;
+ ExtraerPermisos;
+ ShowModal;
+ Result := True;
+ finally
+ Release;
+ end;
+end;
+
function TUsuariosController.AnadirPerfil(APerfil: IBizPerfilUsuario): Boolean;
function GetNewIdUser: Integer;
@@ -330,9 +444,11 @@ end;
function TUsuariosController.ComprobarUsuario(const User,
Password: String): Boolean;
+var
+ SQLStmt : String;
begin
Result := FUserControl.VerificaLogin(User, Password);
- if not Result then
+ if not Result then
begin
if User = 'admin' then
begin
@@ -342,7 +458,32 @@ begin
Result := ComprobarUsuario(User, Password);
end;
end;
- end;
+ end
+ else begin
+ with FUserControl do
+ begin
+ SQLStmt := Format('SELECT %s AS ObjName,' +
+ ' %s AS UCKey,' +
+ ' %s AS UserID' +
+ ' FROM %s' +
+ ' WHERE %s = %s AND %s = %s',
+ [TableRights.FieldComponentName,
+ TableRights.FieldKey,
+ TableRights.FieldUserID,
+ TableRights.TableName + 'EX',
+ TableRights.FieldUserID,
+ IntToStr(CurrentUser.UserID),
+ TableRights.FieldModule,
+ QuotedStr(ApplicationID)]);
+
+ if Assigned(CurrentUser.PerfilUsuario) then
+ begin
+ CurrentUser.PerfilUsuario.Close;
+ CurrentUser.PerfilUsuario.Free;
+ end;
+ CurrentUser.PerfilUsuario := DataConnector.UCGetSQLDataset(SQLStmt);
+ end;
+ end;
end;
constructor TUsuariosController.Create;
@@ -477,6 +618,12 @@ begin
Result := EliminarUsuario(AUser.ID);
end;
+function TUsuariosController.EsAdministrador(AUser: IBizUsuario): Boolean;
+begin
+ if Assigned(AUser) then
+ Result := (AUser.LOGIN = 'admin');
+end;
+
function TUsuariosController.EliminarUsuario(const AIDUser: integer): Boolean;
begin
FUserControl.DataConnector.UCExecSQL('Delete from ' + FUserControl.TableRights.TableName + ' where ' + FUserControl.TableRights.FieldUserID + ' = ' + IntToStr(AIDUser));
@@ -513,6 +660,11 @@ begin
Result := FUsarPasswordsSeguras;
end;
+function TUsuariosController.GetUserControl: TUserControl;
+begin
+ Result := FUserControl;
+end;
+
function TUsuariosController.GuardarPerfil(APerfil: IBizPerfilUsuario): Boolean;
begin
Result := False;
@@ -539,6 +691,34 @@ begin
Result := ModificarUsuario(AUser);
end;
+function TUsuariosController.HayAccesoPermitido(const AActionName: String): Boolean;
+var
+ i: Integer;
+begin
+ Result := False;
+
+ if not Assigned(FUserControl.CurrentUser) then
+ raise Exception.Create('No hay usuario activo (HayAccesoPermitido)');
+
+ if FUserControl.CurrentUser.UserLogin = 'admin' then
+ Result := True
+ else begin
+ with FUserControl.CurrentUser do
+ begin
+ PerfilUsuario.First;
+ for i := 0 to PerfilUsuario.RecordCount - 1 do
+ begin
+ if PerfilUsuario.FieldByName('ObjName').AsString = AActionName then
+ begin
+ Result := True;
+ Break;
+ end;
+ PerfilUsuario.Next;
+ end;
+ end;
+ end;
+end;
+
function TUsuariosController.HayUsuarioConPerfil(
const AIDPerfil: integer): Boolean;
var
@@ -563,7 +743,7 @@ procedure TUsuariosController.InicializarUserControl;
begin
with FUserControl do
begin
- ApplicationID := Application.ExeName;
+ ApplicationID := AppAdminPV.AppEXEName;
AutoStart := False;
Criptografia := cMD5;
CheckValidationKey := True;
diff --git a/Source/ApplicationBase/Usuarios/Views/uEditorPermisosUsuario.dfm b/Source/ApplicationBase/Usuarios/Views/uEditorPermisosUsuario.dfm
new file mode 100644
index 0000000..bf0ba9d
--- /dev/null
+++ b/Source/ApplicationBase/Usuarios/Views/uEditorPermisosUsuario.dfm
@@ -0,0 +1,425 @@
+object fEditorPermisosUsuario: TfEditorPermisosUsuario
+ Left = 255
+ Top = 154
+ BorderStyle = bsDialog
+ Caption = 'Administraci'#243'n de permisos'
+ ClientHeight = 519
+ ClientWidth = 448
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ OldCreateOrder = False
+ Position = poMainFormCenter
+ OnDestroy = FormDestroy
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Panel3: TPanel
+ Left = 351
+ Top = 0
+ Width = 97
+ Height = 484
+ Align = alRight
+ BevelOuter = bvNone
+ TabOrder = 0
+ ExplicitLeft = 445
+ ExplicitTop = 35
+ end
+ object PC: TPageControl
+ Left = 0
+ Top = 0
+ Width = 351
+ Height = 484
+ ActivePage = PageControls
+ Align = alClient
+ Style = tsFlatButtons
+ TabOrder = 1
+ Visible = False
+ ExplicitTop = 35
+ ExplicitWidth = 445
+ object PageMenu: TTabSheet
+ Caption = 'Itens do Menu'
+ ExplicitWidth = 437
+ object TreeMenu: TTreeView
+ Left = 0
+ Top = 0
+ Width = 343
+ Height = 453
+ Align = alClient
+ Ctl3D = True
+ Images = ImageList1
+ Indent = 19
+ ParentCtl3D = False
+ ReadOnly = True
+ RightClickSelect = True
+ TabOrder = 0
+ OnClick = TreeMenuClick
+ OnCollapsing = TreeMenuCollapsing
+ OnExpanding = TreeMenuCollapsing
+ OnKeyPress = TreeMenuKeyPress
+ OnMouseUp = TreeMenuMouseUp
+ ExplicitWidth = 437
+ end
+ end
+ object PageAction: TTabSheet
+ Caption = 'A'#231#245'es'
+ ImageIndex = 1
+ ExplicitWidth = 437
+ object TreeAction: TTreeView
+ Left = 0
+ Top = 0
+ Width = 343
+ Height = 453
+ Align = alClient
+ Ctl3D = True
+ Images = ImageList1
+ Indent = 19
+ ParentCtl3D = False
+ ReadOnly = True
+ RightClickSelect = True
+ TabOrder = 0
+ OnClick = TreeActionClick
+ OnCollapsing = TreeMenuCollapsing
+ OnExpanding = TreeMenuCollapsing
+ OnKeyPress = TreeMenuKeyPress
+ ExplicitWidth = 437
+ end
+ end
+ object PageControls: TTabSheet
+ Caption = 'Controles'
+ ImageIndex = 2
+ ExplicitWidth = 437
+ end
+ end
+ object Panel2: TPanel
+ Left = 0
+ Top = 484
+ Width = 448
+ Height = 35
+ Align = alBottom
+ BevelOuter = bvNone
+ TabOrder = 2
+ ExplicitWidth = 510
+ DesignSize = (
+ 448
+ 35)
+ object bAceptar: TButton
+ Left = 272
+ Top = 0
+ Width = 75
+ Height = 25
+ Anchors = [akRight, akBottom]
+ Caption = '&Aceptar'
+ Default = True
+ ModalResult = 1
+ TabOrder = 0
+ OnClick = bAceptarClick
+ end
+ object bCancelar: TButton
+ Left = 363
+ Top = 0
+ Width = 75
+ Height = 25
+ Anchors = [akRight, akBottom]
+ Cancel = True
+ Caption = '&Cancelar'
+ Default = True
+ ModalResult = 2
+ TabOrder = 1
+ OnClick = bCancelarClick
+ end
+ end
+ object GroupBox1: TGroupBox
+ Left = 8
+ Top = 8
+ Width = 431
+ Height = 458
+ Caption = 'Lista de m'#243'dulos'
+ TabOrder = 3
+ object BtLibera: TBitBtn
+ Left = 14
+ Top = 374
+ Width = 112
+ Height = 25
+ Caption = '&Permitir todo'
+ TabOrder = 0
+ OnClick = BtLiberaClick
+ Glyph.Data = {
+ 36060000424D3606000000000000360000002800000020000000100000000100
+ 18000000000000060000120B0000120B00000000000000000000C8D0D4C8D0D4
+ C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8
+ D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D49FBFD0
+ 0060900060900060900060900060900060900060900060900060900060900060
+ 909FBFD0C8D0D4C8D0D4C8D0D4C2C8CB8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D
+ 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8DC2C8CBC8D0D4C8D0D4C8D0D40090C8
+ 98D8F80090C80090C80090C80090C80090C80090C80090C80090C80090C80090
+ C8006090C8D0D4C8D0D4C8D0D4B5B5B5E7E7E7B6B6B6B5B5B5B5B5B5B5B5B5B5
+ B5B5B5B5B5B6B6B6B5B5B5B5B5B5B5B5B58D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD7ACEF774CCF66EC9F55494A840404045879B4EBBF146B7EF42B5EF0090
+ C8006090C8D0D4C8D0D4C8D0D4B5B5B5F5F5F5E1E1E1E0E0E0DDDDDDB1B1B166
+ 6666A7A7A7D5D5D5D3D3D3D2D2D2B5B5B58D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD83D2F87DD0F777CDF671CAF540404063C5F45AC1F352BDF14AB9F00090
+ C8006090C8D0D4C8D0D4C8D0D4B5B5B5F5F5F5E3E3E3E2E2E2E0E0E0DFDFDF66
+ 6666DBDBDBD8D8D8D7D7D7D4D4D4B6B6B68D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD89D5F983D2F87DD0F740404040404040404063C5F45AC1F352BDF10090
+ C8006090C8D0D4C8D0D4C8D0D4B5B5B5F6F6F6E5E5E5E3E3E3E2E2E267676766
+ 6666666666DCDCDCD9D9D9D6D6D6B6B6B68D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD8FD8FA89D5F983D2F862AABE40404062AABE6BC8F563C5F45AC1F30090
+ C8006090C8D0D4C8D0D4C8D0D4B5B5B5F6F6F6E7E7E7E5E5E5E3E3E3C2C2C266
+ 6666C2C2C2DDDDDDDCDCDCD9D9D9B6B6B68D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD95DBFB8FD8FA89D5F983D2F87DD0F777CDF671CAF56BC8F563C5F40090
+ C8006090C8D0D4C8D0D4C8D0D4B6B6B6F5F5F5E9E9E9E7E7E7E5E5E5E3E3E3E2
+ E2E2E0E0E0DFDFDFDDDDDDDCDCDCB5B5B58D8D8DC8D0D4C8D0D4C8D0D40090C8
+ 98D8F8D7EFFDD7EFFDD7EFFDD7EFFDD7EFFDD7EFFDD7EFFDD7EFFDD7EFFD98D8
+ F8006090C8D0D4C8D0D4C8D0D4B5B5B5E7E7E7F6F6F6F6F6F6F6F6F6F6F6F6F6
+ F6F6F6F6F6F6F6F6F6F6F6F5F5F5E7E7E78D8D8DC8D0D4C8D0D4C8D0D49FBFD0
+ 028DC70090C80090C80090C80090C80090C80090C80090C80090C80090C80090
+ C89FBFD0C8D0D4C8D0D4C8D0D4C2C8CBB4B4B4B6B6B6B6B6B6B6B6B6B5B5B5B5
+ B5B5B5B5B5B6B6B6B6B6B6B5B5B5B5B5B5C2C8CBC8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D40090C860C8F8006090C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8
+ D0D4C8D0D4B6B6B6DDDDDD8D8D8DC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D40090C8006090006090C8D0D4C8D0D4C8D0D40090C860C8F8006090C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4B6B6B68D8D8D8D8D8DC8D0D4C8
+ D0D4C8D0D4B6B6B6DDDDDD8D8D8DC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D40090C8D7EFFD0060909FBFD0C8D0D49FBFD00090C860C8F8006090C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4B5B5B5F6F6F68D8D8DC2C8CBC8
+ D0D4C2C8CBB5B5B5DDDDDD8D8D8DC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D47FB1CDD7EFFD98D8F800609000609000609098D8F860C8F8367EA3C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4BDC2C4F5F5F5E7E7E78D8D8D8E
+ 8E8E8D8D8DE7E7E7DDDDDD9EA0A1C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D49FBFD07FB1CDD7EFFDD7EFFDD7EFFDD7EFFD4DB9EC367EA39FBFD0C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C2C8CBBDC2C4F6F6F6F6F6F6F6
+ F6F6F6F6F6D3D3D39EA0A1C2C8CBC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D4C8D0D49FBFD07FB1CD0090C80090C80090C87FB1CD9FBFD0C8D0D4C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C2C8CBBDC2C4B5B5B5B5
+ B5B5B5B5B5BDC2C4C2C8CBC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4}
+ NumGlyphs = 2
+ end
+ object BtBloqueia: TBitBtn
+ Left = 14
+ Top = 413
+ Width = 112
+ Height = 25
+ Caption = '&Bloquear todo'
+ TabOrder = 1
+ OnClick = BtBloqueiaClick
+ Glyph.Data = {
+ 36060000424D3606000000000000360000002800000020000000100000000100
+ 18000000000000060000120B0000120B00000000000000000000C8D0D4C8D0D4
+ C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8
+ D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D49FBFD0
+ 0060900060900060900060900060900060900060900060900060900060900060
+ 909FBFD0C8D0D4C8D0D4C8D0D4C2C8CB8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D
+ 8D8D8D8D8D8E8E8E8D8D8D8D8D8D8D8D8DC2C8CBC8D0D4C8D0D4C8D0D40090C8
+ 98D8F80090C80090C80090C80090C80090C80090C80090C80090C80090C80090
+ C8006090C8D0D4C8D0D4C8D0D4B6B6B6E7E7E7B5B5B5B6B6B6B5B5B5B5B5B5B5
+ B5B5B6B6B6B5B5B5B5B5B5B6B6B6B6B6B68D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD7ACEF774CCF66EC9F55494A840404045879B4EBBF146B7EF42B5EF0090
+ C8006090C8D0D4C8D0D4C8D0D4B5B5B5F5F5F5E1E1E1E0E0E0DDDDDDB1B1B166
+ 6666A7A7A7D5D5D5D3D3D3D2D2D2B6B6B68D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD83D2F87DD0F777CDF671CAF540404063C5F45AC1F352BDF14AB9F00090
+ C8006090C8D0D4C8D0D4C8D0D4B6B6B6F6F6F6E3E3E3E2E2E2E0E0E0DFDFDF66
+ 6666DCDCDCD9D9D9D7D7D7D4D4D4B6B6B68D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD89D5F983D2F87DD0F740404040404040404063C5F45AC1F352BDF10090
+ C8006090C8D0D4C8D0D4C8D0D4B5B5B5F5F5F5E5E5E5E3E3E3E2E2E266666666
+ 6666666666DCDCDCD8D8D8D6D6D6B5B5B58D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD8FD8FA89D5F983D2F862AABE40404062AABE6BC8F563C5F45AC1F30090
+ C8006090C8D0D4C8D0D4C8D0D4B6B6B6F6F6F6E7E7E7E6E6E6E3E3E3C2C2C267
+ 6767C2C2C2DDDDDDDBDBDBD9D9D9B6B6B68D8D8DC8D0D4C8D0D4C8D0D40090C8
+ D7EFFD95DBFB8FD8FA89D5F983D2F87DD0F777CDF671CAF56BC8F563C5F40090
+ C8006090C8D0D4C8D0D4C8D0D4B5B5B5F6F6F6E9E9E9E7E7E7E6E6E6E3E3E3E2
+ E2E2E0E0E0DFDFDFDDDDDDDBDBDBB6B6B68D8D8DC8D0D4C8D0D4C8D0D40090C8
+ 98D8F8D7EFFDD7EFFDD7EFFDD7EFFDD7EFFDD7EFFDD7EFFDD7EFFDD7EFFD98D8
+ F8006090C8D0D4C8D0D4C8D0D4B5B5B5E7E7E7F6F6F6F6F6F6F6F6F6F6F6F6F6
+ F6F6F6F6F6F6F6F6F6F6F6F6F6F6E7E7E78D8D8DC8D0D4C8D0D4C8D0D49FBFD0
+ 0090C80090C80090C80090C80090C80090C80090C80090C80090C80090C80090
+ C89FBFD0C8D0D4C8D0D4C8D0D4C2C8CBB5B5B5B6B6B6B6B6B6B5B5B5B6B6B6B5
+ B5B5B6B6B6B6B6B6B5B5B5B5B5B5B6B6B6C2C8CBC8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D40090C8D7EFFD006090C8D0D4C8D0D4C8D0D40090C860C8F8006090C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4B5B5B5F5F5F58D8D8DC8D0D4C8
+ D0D4C8D0D4B5B5B5DDDDDD8D8D8DC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D40090C8D7EFFD0060909FBFD0C8D0D49FBFD00090C860C8F8006090C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4B5B5B5F6F6F68D8D8DC2C8CBC8
+ D0D4C2C8CBB5B5B5DEDEDE8D8D8DC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D47FB1CDD7EFFD98D8F800609000609000609060C8F860C8F8367EA3C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4BDC2C4F6F6F6E7E7E78D8D8D8D
+ 8D8D8D8D8DDEDEDEDDDDDD9EA0A1C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D49FBFD07FB1CDD7EFFDD7EFFDD7EFFDD7EFFD60C8F8367EA39FBFD0C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C2C8CBBDC2C4F6F6F6F6F6F6F6
+ F6F6F6F6F6DDDDDD9EA0A1C2C8CBC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D4C8D0D49FBFD07FB1CD0090C80090C80090C87FB1CD9FBFD0C8D0D4C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C2C8CBBDC2C4B5B5B5B5
+ B5B5B6B6B6BDC2C4C2C8CBC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
+ C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0
+ D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8
+ D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4}
+ NumGlyphs = 2
+ end
+ object TreeControls: TTreeView
+ Left = 14
+ Top = 19
+ Width = 403
+ Height = 342
+ Ctl3D = True
+ Images = ImageList1
+ Indent = 19
+ ParentCtl3D = False
+ ReadOnly = True
+ RightClickSelect = True
+ TabOrder = 2
+ OnClick = TreeControlsClick
+ OnCollapsing = TreeMenuCollapsing
+ OnExpanding = TreeMenuCollapsing
+ OnKeyPress = TreeMenuKeyPress
+ end
+ end
+ object ImageList1: TImageList
+ Left = 360
+ Top = 8
+ Bitmap = {
+ 494C010103000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
+ 0000000000003600000028000000400000001000000001002000000000000010
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400C6DEC600C6DE
+ C600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DE
+ C600C6DEC6000000000000000000000000000000000084848400C6DEC600C6DE
+ C600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DE
+ C600C6DEC6000000000000000000000000000000000084848400C6DEC600C6DE
+ C600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DEC600C6DE
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C600C6C6C600C6C6C60084848400C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C600C6C6C600848484008484840084848400C6C6C600C6C6C600C6C6C600C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C6008484840084848400848484008484840084848400C6C6C600C6C6C600C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C6008484840084848400C6C6C600848484008484840084848400C6C6C600C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C60084848400C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484840084848400C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C60084848400C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC6000000000000000000000000000000000084848400848484000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000C6DEC600000000000000000000000000000000008484840084848400C6C6
+ C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C600C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484008484
+ 8400848484008484840084848400848484008484840084848400848484008484
+ 8400C6DEC6000000000000000000000000000000000084848400848484008484
+ 8400848484008484840084848400848484008484840084848400848484008484
+ 8400C6DEC6000000000000000000000000000000000084848400848484008484
+ 8400848484008484840084848400848484008484840084848400848484008484
+ 8400C6DEC6000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000084848400848484008484
+ 8400848484008484840084848400848484008484840084848400848484008484
+ 8400848484000000000000000000000000000000000084848400848484008484
+ 8400848484008484840084848400848484008484840084848400848484008484
+ 8400848484000000000000000000000000000000000084848400848484008484
+ 8400848484008484840084848400848484008484840084848400848484008484
+ 8400848484000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000424D3E000000000000003E000000
+ 2800000040000000100000000100010000000000800000000000000000000000
+ 000000000000000000000000FFFFFF00FFFFFFFFFFFF0000FFFFFFFFFFFF0000
+ FFFFFFFFFFFF000080078007800700009FF79FF7800700009FF79DF780070000
+ 9FF798F7800700009FF79077800700009FF79237800700009FF7971780070000
+ 9FF79F97800700009FF79FD7800700009FF79FF7800700008007800780070000
+ 8007800780070000FFFFFFFFFFFF000000000000000000000000000000000000
+ 000000000000}
+ end
+end
diff --git a/Source/ApplicationBase/Usuarios/Views/uEditorPermisosUsuario.pas b/Source/ApplicationBase/Usuarios/Views/uEditorPermisosUsuario.pas
new file mode 100644
index 0000000..5df0b81
--- /dev/null
+++ b/Source/ApplicationBase/Usuarios/Views/uEditorPermisosUsuario.pas
@@ -0,0 +1,700 @@
+unit uEditorPermisosUsuario;
+
+interface
+
+uses
+ UCBase, ActnMan, ActnMenus, Variants, Buttons, Classes, ComCtrls, Controls,
+ DB, ExtCtrls, Forms, Graphics, ImgList, Menus, StdCtrls, uBizUsuarios;
+
+type
+ PTreeMenu = ^TTreeMenu;
+
+ TTreeMenu = record
+ Selecionado: Integer;
+ MenuName: String;
+ end;
+
+ PTreeAction = ^TTreeAction;
+
+ TTreeAction = record
+ Grupo: Boolean;
+ Selecionado: Integer;
+ MenuName: String;
+ end;
+
+ PTreeControl = ^TTreeControl;
+
+ TTreeControl = record
+ Grupo: Boolean;
+ Selecionado: Integer;
+ CompName: String;
+ FormName: String;
+ end;
+
+ TfEditorPermisosUsuario = class(TForm)
+ Panel3: TPanel;
+ BtLibera: TBitBtn;
+ BtBloqueia: TBitBtn;
+ ImageList1: TImageList;
+ PC: TPageControl;
+ PageMenu: TTabSheet;
+ PageAction: TTabSheet;
+ TreeMenu: TTreeView;
+ TreeAction: TTreeView;
+ PageControls: TTabSheet;
+ TreeControls: TTreeView;
+ Panel2: TPanel;
+ bAceptar: TButton;
+ bCancelar: TButton;
+ GroupBox1: TGroupBox;
+ procedure BtGravaClick(Sender: TObject);
+ procedure TreeMenuClick(Sender: TObject);
+ procedure BtLiberaClick(Sender: TObject);
+ procedure BtBloqueiaClick(Sender: TObject);
+ procedure FormShow(Sender: TObject);
+ procedure TreeActionClick(Sender: TObject);
+ procedure TreeControlsClick(Sender: TObject);
+ procedure TreeMenuCollapsing(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean);
+ procedure TreeMenuKeyPress(Sender: TObject; var Key: char);
+ procedure TreeMenuMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+ procedure FormDestroy(Sender: TObject);
+ procedure bCancelarClick(Sender: TObject);
+ procedure bAceptarClick(Sender: TObject);
+ private
+ FMenu: TMenu;
+ FActions: TObject;
+ FChangingTree: Boolean;
+ FTempMPointer: PTreeMenu;
+ FTempAPointer: PTreeAction;
+ FTempCPointer: PTreeControl;
+ FExtraRights: TUCExtraRights;
+ FTempLista: TStringList;
+ FListaAction: array of PTreeAction;
+ FListaMenu: array of PTreeMenu;
+ FListaControl: array of PTreeControl;
+ {$IFDEF UCACTMANAGER}
+ FActionMainMenuBar: TActionMainMenuBar;
+ procedure TrataItem(IT: TActionClientItem; node: TTreeNode); overload;
+ {$ENDIF}
+ procedure TrataItem(IT: TMenuItem; node: TTreeNode); overload;
+ procedure TreeMenuItem(marca: Boolean);
+ procedure Atualiza(Selec: Boolean);
+ procedure TreeActionItem(marca: Boolean);
+ procedure UnCheckChild(node: TTreeNode);
+ procedure TreeControlItem(marca: Boolean);
+ procedure CarregaTreeviews;
+ public
+ FUser : IBizUsuario;
+ FUserControl: TUserControl;
+ DSPermiss: TDataset;
+ DSPermissEX: TDataset;
+ DSPerfil: TDataset;
+ DSPerfilEX: TDataset;
+ end;
+
+implementation
+
+uses
+ ActnList, Messages, SysUtils, Windows;
+
+{$R *.dfm}
+
+procedure TfEditorPermisosUsuario.BtGravaClick(Sender: TObject);
+var
+ Contador: Integer;
+begin
+ with FUserControl.TableRights do
+ begin
+ FUserControl.DataConnector.UCExecSQL('Delete from ' + TableName + ' Where ' + FieldUserID + ' = ' + IntToStr(FUser.ID) + ' and ' + FieldModule + ' = ' + QuotedStr(FUserControl.ApplicationID));
+ FUserControl.DataConnector.UCExecSQL('Delete from ' + TableName + 'EX Where ' + FieldUserID + ' = ' + IntToStr(FUser.ID) + ' and ' + FieldModule + ' = ' + QuotedStr(FUserControl.ApplicationID));
+ end;
+
+ for Contador := 0 to TreeMenu.Items.Count - 1 do
+ if PTreeMenu(TreeMenu.Items[Contador].Data).Selecionado = 1 then
+ FUserControl.AddRight(FUser.ID, PTreeMenu(TreeMenu.Items[Contador].Data).MenuName);
+
+ for Contador := 0 to TreeAction.Items.Count - 1 do
+ if PTreeAction(TreeAction.Items[Contador].Data).Selecionado = 1 then
+ FUserControl.AddRight(FUser.ID, PTreeAction(TreeAction.Items[Contador].Data).MenuName);
+
+ //Extra Rights
+ for Contador := 0 to Pred(TreeControls.Items.Count) do
+ if PTreeControl(TreeControls.Items[Contador].Data).Selecionado = 1 then
+ FUserControl.AddRightEX(FUser.ID, FUserControl.ApplicationID, PTreeControl(TreeControls.Items[Contador].Data).FormName, PTreeControl(TreeControls.Items[Contador].Data).CompName);
+
+ Close;
+end;
+
+procedure TfEditorPermisosUsuario.TrataItem(IT: TMenuItem; node: TTreeNode);
+var
+ contador: Integer;
+ TempNode: TTreeNode;
+begin
+ for contador := 0 to IT.Count - 1 do
+ if IT.Items[Contador].Caption <> '-' then
+ if IT.Items[Contador].Count > 0 then
+ begin
+ New(FTempMPointer);
+ SetLength(FListaMenu, Length(FListaMenu) + 1); //Adicionado por Luiz 18/01/06
+ FListaMenu[High(FListaMenu)] := FTempMPointer; //Adicionado por Luiz 18/01/06
+ FTempMPointer.Selecionado := 0;
+ FTempMPointer.MenuName := IT.Items[Contador].Name;
+ TempNode := TreeMenu.Items.AddChildObject(node, StringReplace(IT.Items[Contador].Caption, '&', '', [rfReplaceAll]), FTempMPointer);
+ TrataItem(IT.Items[Contador], TempNode);
+ end
+ else
+ begin
+ New(FTempMPointer);
+ SetLength(FListaMenu, Length(FListaMenu) + 1); //Adicionado por Luiz 18/01/06
+ FListaMenu[High(FListaMenu)] := FTempMPointer; //Adicionado por Luiz 18/01/06
+ FTempMPointer.Selecionado := 0;
+ FTempMPointer.MenuName := IT.Items[Contador].Name;
+ TreeMenu.Items.AddChildObject(node, StringReplace(IT.Items[Contador].Caption, '&', '', [rfReplaceAll]), FTempMPointer);
+ end;
+end;
+
+{$IFDEF UCACTMANAGER}
+procedure TUserPermis.TrataItem(IT: TActionClientItem; node: TTreeNode);
+var
+ contador: Integer;
+ TempNode: TTreeNode;
+begin
+ for contador := 0 to IT.Items.Count - 1 do
+ if IT.Items[Contador].Caption <> '-' then
+ if IT.Items[Contador].Items.Count > 0 then
+ begin
+ New(FTempMPointer);
+ SetLength(FListaMenu, Length(FListaMenu) + 1); //Adicionado por Luiz 18/01/06
+ FListaMenu[High(FListaMenu)] := FTempMPointer; //Adicionado por Luiz 18/01/06
+ FTempMPointer.Selecionado := 0;
+ FTempMPointer.MenuName := #1 + 'G' + IT.Items[Contador].Caption;
+ TempNode := TreeMenu.Items.AddChildObject(node, StringReplace(IT.Items[Contador].Caption, '&', '', [rfReplaceAll]), FTempMPointer);
+ TrataItem(IT.Items[Contador], TempNode);
+ end
+ else
+ begin
+ New(FTempMPointer);
+ SetLength(FListaMenu, Length(FListaMenu) + 1); //Adicionado por Luiz 18/01/06
+ FListaMenu[High(FListaMenu)] := FTempMPointer; //Adicionado por Luiz 18/01/06
+ FTempMPointer.Selecionado := 0;
+ FTempMPointer.MenuName := IT.Items[Contador].Action.Name;
+ TreeMenu.Items.AddChildObject(node, StringReplace(IT.Items[Contador].Caption, '&', '', [rfReplaceAll]), FTempMPointer);
+ end;
+end;
+
+{$ENDIF}
+
+procedure TfEditorPermisosUsuario.CarregaTreeviews;
+var
+ Contador: Integer;
+ TempNode: TTreeNode;
+ Temp: String;
+ Temp2: String;
+ Desc: String;
+begin
+ FChangingTree := False;
+ PC.ActivePage := PageControls;
+
+// Self.FMenu := FUserControl.ControlRight.MainMenu;
+ //Self.FActionMainMenuBar := FUserControl.ControlRight.ActionMainMenuBar;
+{ if Assigned(FUserControl.ControlRight.ActionList) then
+ Self.FActions := FUserControl.ControlRight.ActionList
+ else
+ Self.FActions := FUserControl.ControlRight.ActionManager;}
+
+ Self.FExtraRights := FUserControl.ExtraRights;
+
+{ if Assigned(FMenu) then
+ begin
+ TreeMenu.Items.Clear;
+ for Contador := 0 to FMenu.Items.Count - 1 do
+ if FMenu.Items[Contador].Count > 0 then
+ begin
+ New(FTempMPointer);
+ SetLength(FListaMenu, Length(FListaMenu) + 1); //Adicionado por Luiz 18/01/06
+ FListaMenu[High(FListaMenu)] := FTempMPointer; //Adicionado por Luiz 18/01/06
+ FTempMPointer.Selecionado := 0;
+ FTempMPointer.MenuName := FMenu.Items[Contador].Name;
+ TempNode := TreeMenu.Items.AddObject(nil, StringReplace(FMenu.Items[Contador].Caption, '&', '', [rfReplaceAll]), FTempMPointer);
+ TrataItem(FMenu.Items[Contador], TempNode);
+ end
+ else
+ if FMenu.Items[Contador].Caption <> '-' then
+ begin
+ New(FTempMPointer);
+ SetLength(FListaMenu, Length(FListaMenu) + 1); //Adicionado por Luiz 18/01/06
+ FListaMenu[High(FListaMenu)] := FTempMPointer; //Adicionado por Luiz 18/01/06
+ FTempMPointer.Selecionado := 0;
+ FTempMPointer.MenuName := FMenu.Items[Contador].Name;
+ TreeMenu.Items.AddObject(nil, StringReplace(FMenu.Items[Contador].Caption, '&', '', [rfReplaceAll]), FTempMPointer);
+ end;
+ TreeMenu.FullExpand;
+ TreeMenu.Perform(WM_VSCROLL, SB_TOP, 0);
+ end;
+
+ TempNode := nil;
+ if Assigned(FActions) then
+ begin
+ TreeAction.Items.Clear;
+ if Assigned(FTempLista) then
+ FreeAndNil(FTempLista);
+ FTempLista := TStringList.Create;
+ for Contador := 0 to TActionList(FActions).ActionCount - 1 do
+ FTempLista.Append(TActionList(FActions).Actions[contador].Category + #1 + TActionList(FActions).Actions[contador].Name + #2 + TAction(TActionList(FActions).Actions[contador]).Caption);
+ FTempLista.Sort;
+ Temp := #1;
+ for Contador := 0 to FTempLista.Count - 1 do
+ begin
+ if Temp <> Copy(FTempLista[Contador], 1, Pos(#1, FTempLista[Contador]) - 1) then
+ begin
+ New(FTempAPointer);
+ SetLength(FListaAction, Length(FListaAction) + 1); //Adicionado por Luiz 18/01/06
+ FListaAction[High(FListaAction)] := FTempAPointer; //Adicionado por Luiz 18/01/06
+ FTempAPointer.Grupo := True;
+ FTempAPointer.Selecionado := 0;
+ FTempAPointer.MenuName := 'Grupo';
+ TempNode := TreeAction.Items.AddObject(nil, StringReplace(Copy(FTempLista[Contador], 1, Pos(#1, FTempLista[Contador]) - 1), '&', '', [rfReplaceAll]), FTempAPointer);
+ TempNode.ImageIndex := 2;
+ TempNode.SelectedIndex := 2;
+ Temp := Copy(FTempLista[Contador], 1, Pos(#1, FTempLista[Contador]) - 1);
+ end;
+ Temp2 := FTempLista[Contador];
+ Delete(Temp2, 1, pos(#1, Temp2));
+ New(FTempAPointer);
+ SetLength(FListaAction, Length(FListaAction) + 1); //Adicionado por Luiz 18/01/06
+ FListaAction[High(FListaAction)] := FTempAPointer; //Adicionado por Luiz 18/01/06
+ FTempAPointer.Grupo := False;
+ FTempAPointer.Selecionado := 0;
+ FTempAPointer.MenuName := Copy(Temp2, 1, Pos(#2, Temp2) - 1);
+ Delete(Temp2, 1, pos(#2, Temp2));
+ TreeAction.Items.AddChildObject(TempNode, StringReplace(Temp2, '&', '', [rfReplaceAll]), FTempAPointer);
+ end;
+ TreeAction.FullExpand;
+ TreeAction.Perform(WM_VSCROLL, SB_TOP, 0);
+ end;
+ }
+ //ExtraRights
+ TempNode := nil;
+ if Self.FExtraRights.Count > 0 then
+ begin
+ TreeControls.Items.Clear;
+ if Assigned(FTempLista) then
+ FreeAndNil(FTempLista);
+ FTempLista := TStringList.Create;
+ for Contador := 0 to Pred(FExtraRights.Count) do
+ //FTempLista.Append(FExtraRights[Contador].GroupName + #1 + FExtraRights[Contador].Caption + #2 + FExtraRights[Contador].FormName + #3 + FExtraRights[Contador].CompName);
+ FTempLista.Append(FExtraRights[Contador].GroupName + #1 + FExtraRights[Contador].Caption + #2 + FExtraRights[Contador].Caption + #3 + FExtraRights[Contador].Caption);
+ FTempLista.Sort;
+ Temp := #1;
+ for Contador := 0 to Pred(FTempLista.Count) do
+ begin
+ if Temp <> Copy(FTempLista[Contador], 1, Pos(#1, FTempLista[Contador]) - 1) then
+ begin
+ New(FTempCPointer);
+ SetLength(FListaControl, Length(FListaControl) + 1); //Adicionado por Luiz 18/01/06
+ FListaControl[High(FListaControl)] := FTempCPointer; //Adicionado por Luiz 18/01/06
+ FTempCPointer.Grupo := True;
+ FTempCPointer.Selecionado := 0;
+ FTempCPointer.FormName := 'Grupo';
+ FTempCPointer.CompName := 'Grupo';
+ TempNode := TreeControls.Items.AddObject(nil, Copy(FTempLista[Contador], 1, Pos(#1, FTempLista[Contador]) - 1), FTempCPointer);
+ TempNode.ImageIndex := 2;
+ TempNode.SelectedIndex := 2;
+ Temp := Copy(FTempLista[Contador], 1, Pos(#1, FTempLista[Contador]) - 1);
+ end;
+ Temp2 := FTempLista[Contador];
+ Delete(Temp2, 1, pos(#1, Temp2));
+ New(FTempCPointer);
+ SetLength(FListaControl, Length(FListaControl) + 1); //Adicionado por Luiz 18/01/06
+ FListaControl[High(FListaControl)] := FTempCPointer; //Adicionado por Luiz 18/01/06
+ FTempCPointer.Grupo := False;
+ FTempCPointer.Selecionado := 0;
+ Desc := Copy(Temp2, 1, Pos(#2, Temp2) - 1); // descricao do objeto
+ Delete(Temp2, 1, pos(#2, Temp2));
+
+ FTempCPointer.FormName := Copy(Temp2, 1, Pos(#3, Temp2) - 1);
+ Delete(Temp2, 1, pos(#3, Temp2));
+ FTempCPointer.CompName := Temp2;
+ TreeControls.Items.AddChildObject(TempNode, Desc, FTempCPointer);
+ FTempCPointer := nil;
+ end;
+ TreeControls.FullExpand;
+ TreeControls.Perform(WM_VSCROLL, SB_TOP, 0);
+ end;
+
+{ PageMenu.TabVisible := Assigned(FMenu);
+
+ PageAction.TabVisible := Assigned(FActions);}
+
+ PageControls.TabVisible := (Assigned(FExtraRights) and (FExtraRights.Count > 0));
+end;
+
+procedure TfEditorPermisosUsuario.UnCheckChild(node: TTreeNode);
+var
+ child: TTreeNode;
+begin
+ PTreemenu(node.Data).Selecionado := 0;
+ node.ImageIndex := 0;
+ node.SelectedIndex := 0;
+ child := node.GetFirstChild;
+ repeat
+ if child.HasChildren then
+ UnCheckChild(child)
+ else
+ begin
+ PTreemenu(child.Data).Selecionado := 0;
+ child.ImageIndex := 0;
+ child.SelectedIndex := 0;
+ end;
+ child := node.GetNextChild(child);
+ until child = nil;
+end;
+
+procedure TfEditorPermisosUsuario.TreeMenuItem(Marca: Boolean);
+var
+ AbsIdx: Integer;
+begin
+ if Marca then
+ if PTreemenu(TreeMenu.Selected.Data).Selecionado < 2 then
+ begin
+ if PTreemenu(TreeMenu.Selected.Data).Selecionado = 0 then //marcar
+ begin
+ AbsIdx := TreeMenu.Selected.AbsoluteIndex;
+ while AbsIdx > -1 do
+ begin
+ PTreemenu(TreeMenu.Items.Item[AbsIdx].Data).Selecionado := 1;
+ TreeMenu.Items.Item[AbsIdx].ImageIndex := 1;
+ TreeMenu.Items.Item[AbsIdx].SelectedIndex := 1;
+ if TreeMenu.Items.Item[AbsIdx].Parent <> nil then
+ begin
+ AbsIdx := TreeMenu.Items.Item[AbsIdx].Parent.AbsoluteIndex;
+ if PTreemenu(TreeMenu.Items.Item[AbsIdx].Data).Selecionado = 2 then
+ AbsIdx := -1;
+ end
+ else
+ AbsIdx := -1;
+ end;
+ end
+ else
+ if TreeMenu.Selected.HasChildren then
+ UnCheckChild(TreeMenu.Selected)
+ else
+ begin
+ PTreemenu(TreeMenu.Selected.Data).Selecionado := 0;
+ TreeMenu.Selected.ImageIndex := 0;
+ TreeMenu.Selected.SelectedIndex := 0;
+ end; //desmarcar
+ TreeMenu.Repaint;
+ end;
+end;
+
+procedure TfEditorPermisosUsuario.TreeActionItem(marca: Boolean);
+begin
+ if not Assigned(FActions) then
+ Exit;
+ if PTreeAction(TreeAction.Selected.Data).Grupo then
+ Exit;
+ if Marca then
+ begin
+ if PTreeAction(TreeAction.Selected.Data).Selecionado < 2 then
+ if PTreeAction(TreeAction.Selected.Data).Selecionado = 0 then
+ PTreeAction(TreeAction.Selected.Data).Selecionado := 1
+ else
+ PTreeAction(TreeAction.Selected.Data).Selecionado := 0;
+ TreeAction.Selected.ImageIndex := PTreeAction(TreeAction.Selected.Data).Selecionado;
+ TreeAction.Selected.SelectedIndex := PTreeAction(TreeAction.Selected.Data).Selecionado;
+ end;
+ TreeAction.Repaint;
+end;
+
+procedure TfEditorPermisosUsuario.TreeControlItem(marca: Boolean);
+begin
+ if PTreeControl(TreeControls.Selected.Data).Grupo then
+ Exit;
+ if Marca then
+ begin
+ if PTreeControl(TreeControls.Selected.Data).Selecionado < 2 then
+ if PTreeControl(TreeControls.Selected.Data).Selecionado = 0 then
+ PTreeControl(TreeControls.Selected.Data).Selecionado := 1
+ else
+ PTreeControl(TreeControls.Selected.Data).Selecionado := 0;
+ TreeControls.Selected.ImageIndex := PTreeControl(TreeControls.Selected.Data).Selecionado;
+ TreeControls.Selected.SelectedIndex := PTreeAction(TreeControls.Selected.Data).Selecionado;
+ end;
+ TreeControls.Repaint;
+end;
+
+procedure TfEditorPermisosUsuario.TreeMenuClick(Sender: TObject);
+begin
+ if not FChangingTree then
+ TreeMenuItem(True);
+end;
+
+procedure TfEditorPermisosUsuario.BtLiberaClick(Sender: TObject);
+begin
+ Atualiza(True);
+end;
+
+procedure TfEditorPermisosUsuario.bCancelarClick(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TfEditorPermisosUsuario.Atualiza(Selec: Boolean);
+var
+ Contador: Integer;
+ Temp: Integer;
+begin
+ if Selec then
+ Temp := 1
+ else
+ Temp := 0;
+
+ if PC.ActivePage = PageMenu then
+ begin
+ for Contador := 0 to TreeMenu.Items.Count - 1 do
+ if PTreeMenu(TreeMenu.Items[Contador].Data).Selecionado < 2 then
+ begin
+ PTreeMenu(TreeMenu.Items[Contador].Data).Selecionado := Temp;
+ TreeMenu.Items[Contador].ImageIndex := Temp;
+ TreeMenu.Items[Contador].SelectedIndex := Temp;
+ end;
+ TreeMenu.Repaint;
+ end
+ else
+ if PC.ActivePage = PageAction then
+ begin
+ for Contador := 0 to TreeAction.Items.Count - 1 do
+ if not PTreeAction(TreeAction.Items[Contador].Data).Grupo then
+ if PTreeAction(TreeAction.Items[Contador].Data).Selecionado < 2 then
+ begin
+ PTreeAction(TreeAction.Items[Contador].Data).Selecionado := Temp;
+ TreeAction.Items[Contador].ImageIndex := Temp;
+ TreeAction.Items[Contador].SelectedIndex := Temp;
+ end;
+ TreeAction.Repaint;
+ end
+ else
+ begin // tabContols
+ for Contador := 0 to TreeControls.Items.Count - 1 do
+ if not PTreeControl(TreeControls.Items[Contador].Data).Grupo then
+ if PTreeControl(TreeControls.Items[Contador].Data).Selecionado < 2 then
+ begin
+ PTreeControl(TreeControls.Items[Contador].Data).Selecionado := Temp;
+ TreeControls.Items[Contador].ImageIndex := Temp;
+ TreeControls.Items[Contador].SelectedIndex := Temp;
+ end;
+ TreeControls.Repaint;
+ end;
+end;
+
+
+procedure TfEditorPermisosUsuario.bAceptarClick(Sender: TObject);
+var
+ Contador: Integer;
+begin
+ with FUserControl.TableRights do
+ begin
+ FUserControl.DataConnector.UCExecSQL('Delete from ' + TableName + ' Where ' + FieldUserID + ' = ' + IntToStr(FUser.ID) + ' and ' + FieldModule + ' = ' + QuotedStr(FUserControl.ApplicationID));
+ FUserControl.DataConnector.UCExecSQL('Delete from ' + TableName + 'EX Where ' + FieldUserID + ' = ' + IntToStr(FUser.ID) + ' and ' + FieldModule + ' = ' + QuotedStr(FUserControl.ApplicationID));
+ end;
+
+ for Contador := 0 to TreeMenu.Items.Count - 1 do
+ if PTreeMenu(TreeMenu.Items[Contador].Data).Selecionado = 1 then
+ FUserControl.AddRight(FUser.ID, PTreeMenu(TreeMenu.Items[Contador].Data).MenuName);
+
+ for Contador := 0 to TreeAction.Items.Count - 1 do
+ if PTreeAction(TreeAction.Items[Contador].Data).Selecionado = 1 then
+ FUserControl.AddRight(FUser.ID, PTreeAction(TreeAction.Items[Contador].Data).MenuName);
+
+ //Extra Rights
+ for Contador := 0 to Pred(TreeControls.Items.Count) do
+ if PTreeControl(TreeControls.Items[Contador].Data).Selecionado = 1 then
+ FUserControl.AddRightEX(FUser.ID, FUserControl.ApplicationID, PTreeControl(TreeControls.Items[Contador].Data).FormName, PTreeControl(TreeControls.Items[Contador].Data).CompName);
+
+ Close;
+end;
+
+procedure TfEditorPermisosUsuario.BtBloqueiaClick(Sender: TObject);
+begin
+ Atualiza(False);
+end;
+
+procedure TfEditorPermisosUsuario.FormShow(Sender: TObject);
+var
+ Contador: Integer;
+ Selec: Integer;
+begin
+ Caption := 'Permisos para ' + FUser.USERNAME;
+
+ // Adcionado por Luiz
+ SetLength(FListaAction, 0);
+ SetLength(FListaMenu, 0);
+ SetLength(FListaControl, 0);
+
+ //carrega itens do menu, actions e controles
+ CarregaTreeviews;
+
+ // Exibe Permissoes do Usuario
+ for Contador := 0 to TreeAction.Items.Count - 1 do
+ begin
+ DSPermiss.First;
+ if DSPermiss.Locate('ObjName', PTreeAction(TreeAction.Items[Contador].Data).MenuName, []) then
+ Selec := 1
+ else
+ Selec := 0;
+
+ PTreeAction(TreeAction.Items[Contador].Data).Selecionado := Selec;
+ if not PTreeAction(TreeAction.Items[Contador].Data).Grupo then
+ begin
+ TreeAction.Items[Contador].ImageIndex := Selec;
+ TreeAction.Items[Contador].SelectedIndex := Selec;
+ end;
+ end;
+
+ for Contador := 0 to TreeMenu.Items.Count - 1 do
+ begin
+ DSPermiss.First;
+ if DSPermiss.Locate('ObjName', PTreeMenu(TreeMenu.Items[Contador].Data).MenuName, []) then
+ Selec := 1
+ else
+ Selec := 0;
+
+ PTreeMenu(TreeMenu.Items[Contador].Data).Selecionado := Selec;
+ TreeMenu.Items[Contador].ImageIndex := Selec;
+ TreeMenu.Items[Contador].SelectedIndex := Selec;
+ end;
+
+ //Extra Rights
+ for Contador := 0 to Pred(TreeControls.Items.Count) do
+ begin
+ DSPermissEX.First;
+ if DSPermissEX.Locate('FormName;ObjName', VarArrayOf([PTreeControl(TreeControls.Items[Contador].Data).FormName, PTreeControl(TreeControls.Items[Contador].Data).CompName]), []) then
+ Selec := 1
+ else
+ Selec := 0;
+
+ PTreeControl(TreeControls.Items[Contador].Data).Selecionado := Selec;
+ if not PTreeControl(TreeControls.Items[Contador].Data).Grupo then
+ begin
+ TreeControls.Items[Contador].ImageIndex := Selec;
+ TreeControls.Items[Contador].SelectedIndex := Selec;
+ end;
+ end;
+
+ // Exibe Permissoes do Perfil
+ if DSPerfil.Active then
+ begin
+ for Contador := 0 to TreeAction.Items.Count - 1 do
+ begin
+ DSPerfil.First;
+ if DSPerfil.Locate('ObjName', PTreeAction(TreeAction.Items[Contador].Data).MenuName, []) then
+ begin
+ Selec := 2;
+ PTreeAction(TreeAction.Items[Contador].Data).Selecionado := Selec;
+ if not PTreeAction(TreeAction.Items[Contador].Data).Grupo then
+ begin
+ TreeAction.Items[Contador].ImageIndex := Selec;
+ TreeAction.Items[Contador].SelectedIndex := Selec;
+ end;
+ end;
+ end;
+
+ for Contador := 0 to TreeMenu.Items.Count - 1 do
+ begin
+ DSPerfil.First;
+ if DSPerfil.Locate('ObjName', PTreeMenu(TreeMenu.Items[Contador].Data).MenuName, []) then
+ begin
+ Selec := 2;
+ PTreeMenu(TreeMenu.Items[Contador].Data).Selecionado := Selec;
+ TreeMenu.Items[Contador].ImageIndex := Selec;
+ TreeMenu.Items[Contador].SelectedIndex := Selec;
+ end;
+ end;
+
+ //Extra Rights
+ for Contador := 0 to Pred(TreeControls.Items.Count) do
+ begin
+ DSPerfilEX.First;
+ if DSPerfilEX.Locate('FormName;ObjName', VarArrayOf([PTreeControl(TreeControls.Items[Contador].Data).FormName, PTreeControl(TreeControls.Items[Contador].Data).CompName]), []) then
+ begin
+ Selec := 2;
+ PTreeControl(TreeControls.Items[Contador].Data).Selecionado := Selec;
+ if not PTreeControl(TreeControls.Items[Contador].Data).Grupo then
+ begin
+ TreeControls.Items[Contador].ImageIndex := Selec;
+ TreeControls.Items[Contador].SelectedIndex := Selec;
+ end;
+ end;
+ end;
+ end;
+
+ TreeAction.Repaint;
+ TreeMenu.Repaint;
+ FChangingTree := False;
+end;
+
+procedure TfEditorPermisosUsuario.TreeActionClick(Sender: TObject);
+begin
+ if not FChangingTree then
+ TreeActionItem(True);
+end;
+
+procedure TfEditorPermisosUsuario.TreeControlsClick(Sender: TObject);
+begin
+ if not FChangingTree then
+ TreeControlItem(True);
+end;
+
+procedure TfEditorPermisosUsuario.TreeMenuCollapsing(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean);
+begin
+ if (Self.Showing) and (TTreeView(Sender).Focused) then
+ FChangingTree := True;
+end;
+
+procedure TfEditorPermisosUsuario.TreeMenuKeyPress(Sender: TObject; var Key: char);
+begin
+ if Key = ' ' then
+ begin
+ TTreeView(Sender).OnClick(Sender);
+ Key := #0;
+ end;
+end;
+
+procedure TfEditorPermisosUsuario.TreeMenuMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+ FChangingTree := False;
+end;
+
+procedure TfEditorPermisosUsuario.FormDestroy(Sender: TObject);
+var
+ Contador: Integer;
+begin
+ // Adicionado por Luiz 18/01/06
+ if Assigned(DSPermiss) then
+ FreeAndNil(DSPermiss);
+
+ if Assigned(DSPermissEX) then
+ FreeAndNil(DSPermissEX);
+
+ if Assigned(DSPerfil) then
+ FreeAndNil(DSPerfil);
+
+ if Assigned(DSPerfilEX) then
+ FreeAndNil(DSPerfilEX);
+
+ if Assigned(FTempLista) then
+ FreeAndNil(FTempLista);
+
+ for Contador := 0 to High(FListaMenu) do
+ Dispose(FListaMenu[Contador]);
+
+ for Contador := 0 to High(FListaAction) do
+ Dispose(FListaAction[Contador]);
+
+ for Contador := 0 to High(FListaControl) do
+ Dispose(FListaControl[Contador]);
+end;
+
+end.
+
diff --git a/Source/ApplicationBase/Usuarios/Views/uEditorUsuario.dfm b/Source/ApplicationBase/Usuarios/Views/uEditorUsuario.dfm
index 8ee899b..5c93909 100644
--- a/Source/ApplicationBase/Usuarios/Views/uEditorUsuario.dfm
+++ b/Source/ApplicationBase/Usuarios/Views/uEditorUsuario.dfm
@@ -40,12 +40,11 @@ inherited fEditorUsuario: TfEditorUsuario
ParentFont = False
TabOrder = 3
ReadOnly = False
- ExplicitTop = 76
- ExplicitWidth = 656
- ExplicitHeight = 370
+ ExplicitLeft = 8
+ ExplicitTop = 8
inherited dxLayoutControlArticulo: TdxLayoutControl
Width = 656
- ExplicitWidth = 656
+ LookAndFeel = dxLayoutOfficeLookAndFeel1
inherited PngSpeedButton3: TPngSpeedButton
Top = 84
ExplicitTop = 84
@@ -83,9 +82,6 @@ inherited fEditorUsuario: TfEditorUsuario
Top = 112
ExplicitTop = 112
end
- inherited dxLayoutGroup1: TdxLayoutGroup
- LookAndFeel = dxLayoutOfficeLookAndFeel1
- end
end
end
inherited EditorActionList: TActionList [4]
@@ -117,8 +113,6 @@ inherited fEditorUsuario: TfEditorUsuario
end
inherited JvFormStorage: TJvFormStorage [7]
end
- inherited JvAppRegistryStorage: TJvAppRegistryStorage [8]
- end
inherited dsDataTable: TDADataSource
OnDataChange = dsDataTableDataChange
Top = 80
diff --git a/Source/ApplicationBase/Usuarios/Views/uEditorUsuarios.dfm b/Source/ApplicationBase/Usuarios/Views/uEditorUsuarios.dfm
index 3ed7895..8d5e8b9 100644
--- a/Source/ApplicationBase/Usuarios/Views/uEditorUsuarios.dfm
+++ b/Source/ApplicationBase/Usuarios/Views/uEditorUsuarios.dfm
@@ -18,10 +18,13 @@ inherited fEditorUsuarios: TfEditorUsuarios
Width = 840
ExplicitWidth = 840
inherited tbxMain: TTBXToolbar
- ExplicitWidth = 348
+ ExplicitWidth = 494
object TBXItem39: TTBXItem [8]
Action = actCambiarPassword
end
+ object TBXItem35: TTBXItem [9]
+ Action = actControlAcceso
+ end
end
inherited tbxMenu: TTBXToolbar
ExplicitWidth = 840
@@ -33,10 +36,10 @@ inherited fEditorUsuarios: TfEditorUsuarios
end
end
inherited tbxFiltro: TTBXToolbar
- Left = 348
+ Left = 494
DockPos = 346
Visible = False
- ExplicitLeft = 348
+ ExplicitLeft = 494
end
end
inherited StatusBar: TStatusBar
@@ -47,6 +50,7 @@ inherited fEditorUsuarios: TfEditorUsuarios
end
inherited EditorActionList: TActionList
inherited actNuevo: TAction
+ Caption = 'Nuevo usuario'
OnExecute = actNuevoExecute
end
inherited actModificar: TAction
@@ -67,5 +71,22 @@ inherited fEditorUsuarios: TfEditorUsuarios
OnExecute = actCambiarPasswordExecute
OnUpdate = actCambiarPasswordUpdate
end
+ object actControlAcceso: TAction
+ Category = 'Herramientas'
+ Caption = 'Control de acceso...'
+ OnExecute = actControlAccesoExecute
+ OnUpdate = actControlAccesoUpdate
+ end
+ end
+ inherited GridPopupMenu: TPopupMenu
+ object Cambiarlacontrasea1: TMenuItem [0]
+ Action = actCambiarPassword
+ end
+ object Controldeacceso1: TMenuItem [1]
+ Action = actControlAcceso
+ end
+ object N3: TMenuItem [2]
+ Caption = '-'
+ end
end
end
diff --git a/Source/ApplicationBase/Usuarios/Views/uEditorUsuarios.pas b/Source/ApplicationBase/Usuarios/Views/uEditorUsuarios.pas
index edb5738..cc59191 100644
--- a/Source/ApplicationBase/Usuarios/Views/uEditorUsuarios.pas
+++ b/Source/ApplicationBase/Usuarios/Views/uEditorUsuarios.pas
@@ -18,6 +18,11 @@ type
TBXSubmenuItem2: TTBXSubmenuItem;
TBXItem38: TTBXItem;
TBXItem39: TTBXItem;
+ Cambiarlacontrasea1: TMenuItem;
+ actControlAcceso: TAction;
+ Controldeacceso1: TMenuItem;
+ N3: TMenuItem;
+ TBXItem35: TTBXItem;
procedure actEliminarUpdate(Sender: TObject);
procedure actCambiarPasswordUpdate(Sender: TObject);
procedure actCambiarPasswordExecute(Sender: TObject);
@@ -25,9 +30,12 @@ type
procedure actEliminarExecute(Sender: TObject);
procedure actModificarExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
+ procedure actControlAccesoExecute(Sender: TObject);
+ procedure actControlAccesoUpdate(Sender: TObject);
private
FUsuarios : IBizUsuario;
FController : IUsuariosController;
+ function HayDatos: Boolean;
protected
function GetController : IUsuariosController;
procedure SetController (const Value : IUsuariosController);
@@ -72,8 +80,27 @@ end;
procedure TfEditorUsuarios.actCambiarPasswordUpdate(Sender: TObject);
begin
inherited;
-{ if (Sender as TAction).Enabled then
- (Sender as TAction).Enabled := HayDatos;}
+ if (Sender as TAction).Enabled then
+ (Sender as TAction).Enabled := HayDatos;
+end;
+
+procedure TfEditorUsuarios.actControlAccesoExecute(Sender: TObject);
+begin
+ inherited;
+ FController.AdministrarAccesos(FUsuarios);
+end;
+
+function TfEditorUsuarios.HayDatos: Boolean;
+begin
+ Result := Assigned(dsDataTable.DataTable) and (dsDataTable.DataTable.State <> dsInactive)
+ and (not dsDataTable.DataTable.IsEmpty);
+end;
+
+procedure TfEditorUsuarios.actControlAccesoUpdate(Sender: TObject);
+begin
+ inherited;
+ if (Sender as TAction).Enabled then
+ (Sender as TAction).Enabled := HayDatos;
end;
procedure TfEditorUsuarios.actEliminarExecute(Sender: TObject);
diff --git a/Source/ApplicationBase/Usuarios/Views/uUsuariosViewRegister.pas b/Source/ApplicationBase/Usuarios/Views/uUsuariosViewRegister.pas
index f5f67fe..15e32ca 100644
--- a/Source/ApplicationBase/Usuarios/Views/uUsuariosViewRegister.pas
+++ b/Source/ApplicationBase/Usuarios/Views/uUsuariosViewRegister.pas
@@ -9,7 +9,7 @@ implementation
uses
uEditorRegistryUtils, uEditorLogin, Dialogs, uEditorUsuario, uEditorUsuarios,
- uEditorPerfilesUsuario, uEditorPerfilUsuario;
+ uEditorPerfilesUsuario, uEditorPerfilUsuario, uEditorPermisosUsuario;
procedure RegisterViews;
begin
@@ -19,6 +19,7 @@ begin
EditorRegistry.RegisterClass(TfEditorPerfilesUsuario, 'EditorPerfilesUsuario');
EditorRegistry.RegisterClass(TfEditorPerfilUsuario, 'EditorPerfilUsuario');
+
end;
procedure UnregisterViews;
@@ -28,6 +29,7 @@ begin
EditorRegistry.UnRegisterClass(TfEditorUsuario);
EditorRegistry.UnRegisterClass(TfEditorPerfilesUsuario);
EditorRegistry.UnRegisterClass(TfEditorPerfilUsuario);
+
end;
end.
diff --git a/Source/ApplicationBase/uAdminPV_App.pas b/Source/ApplicationBase/uAdminPV_App.pas
index e2120e2..9f462f2 100644
--- a/Source/ApplicationBase/uAdminPV_App.pas
+++ b/Source/ApplicationBase/uAdminPV_App.pas
@@ -24,6 +24,7 @@ type
['{FB6A0F3C-C1D1-462D-AFD4-2A368F85E920}']
function GetMainForm: TCustomForm;
function GetUsuariosController: IUsuariosController;
+ function GetAppEXEName: String;
function GetAppName: String;
function GetAppVersion: String;
function GetAppFullName: String;
@@ -47,6 +48,7 @@ type
procedure Terminate;
property AppVersion : String read GetAppVersion;
+ property AppEXEName : String read GetAppEXEName;
property AppName : String read GetAppName;
property AppFullName : String read GetAppFullName;
property MainForm : TCustomForm read GetMainForm;
@@ -75,6 +77,7 @@ type
function GetMainForm: TCustomForm;
function GetUsuariosController: IUsuariosController;
function GetAppName: String;
+ function GetAppEXEName: String;
function GetAppVersion: String;
function GetAppFullName: String;
function GetUsuarioActivo: IBizUsuario;
@@ -107,6 +110,7 @@ type
procedure Terminate;
property AppVersion : String read GetAppVersion;
+ property AppEXEName : String read GetAppEXEName;
property AppName : String read GetAppName;
property AppFullName : String read GetAppFullName;
property MainForm : TCustomForm read GetMainForm;
@@ -187,6 +191,11 @@ begin
Result := FDoMainFormEvent;
end;
+function TAppAdminPV.GetAppEXEName: String;
+begin
+ Result := ExtractFileName(Application.ExeName);
+end;
+
function TAppAdminPV.GetAppFullName: String;
begin
Result := uAppInfoUtils.GetAppFullName;
@@ -266,8 +275,8 @@ begin
HideHourglassCursor;
HideSplashForm;
end;
+ Application.Run;
end;
- Application.Run;
Terminate;
end;
@@ -304,7 +313,6 @@ end;
procedure TAppAdminPV.Terminate;
begin
- UsuariosController.Logoff;
ModuleManager.UnloadModules;
FTerminated := True;
end;
diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj
index 7f91f97..e77a3ba 100644
--- a/Source/Base/Base.dproj
+++ b/Source/Base/Base.dproj
@@ -40,6 +40,12 @@
Package
FalseTrueFalseFalseFalseTrueC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2000FalseFalseFalseFalseFalse308212522.0.0.01.0.0.0
+
+
+
+
+
+
CodeGear WebSnap Components
CodeGear SOAP Components
Microsoft Office XP Sample Automation Server Wrapper Components
diff --git a/Source/Base/Base.drc b/Source/Base/Base.drc
index 0fba550..ba16db1 100644
--- a/Source/Base/Base.drc
+++ b/Source/Base/Base.drc
@@ -15,10 +15,10 @@ BEGIN
END
/* C:\Varela_D2007\Source\Base\uConfigurarConexion.dfm */
-/* C:\Varela_D2007\Source\Base\uDMBase.dfm */
+/* C:\Varela_D2007\Source\Base\uDMBase.DFM */
/* C:\Varela_D2007\Source\Base\uViewBase.dfm */
/* C:\Varela_D2007\Source\Base\uEditorBase.dfm */
-/* C:\Varela_D2007\Source\Base\uDataModuleBase.dfm */
+/* C:\Varela_D2007\Source\Base\uDataModuleBase.DFM */
/* C:\Varela_D2007\Source\Base\uViewGridBase.dfm */
/* C:\Varela_D2007\Source\Base\uEditorItem.dfm */
/* C:\Varela_D2007\Source\Base\uEditorDBBase.dfm */
@@ -29,4 +29,4 @@ END
/* C:\Varela_D2007\Source\Base\uViewBarraSeleccion.dfm */
/* C:\Varela_D2007\Source\Base\uViewGrid.dfm */
/* C:\Varela_D2007\Source\Base\Base.res */
-/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf57.tmp */
+/* C:\Varela_D2007\Source\Base\Base.drf */
diff --git a/Source/Base/uEditorBase.dfm b/Source/Base/uEditorBase.dfm
index b99e388..893cd2b 100644
--- a/Source/Base/uEditorBase.dfm
+++ b/Source/Base/uEditorBase.dfm
@@ -15,8 +15,6 @@ object fEditorBase: TfEditorBase
Position = poDefault
OnCloseQuery = FormCloseQuery
OnShow = FormShow
- InstanceID = 0
- ReadOnly = False
PixelsPerInch = 96
TextHeight = 13
object JvNavPanelHeader: TJvNavPanelHeader
diff --git a/Source/CargaEDI/CargaEDI.drc b/Source/CargaEDI/CargaEDI.drc
index 118416c..d5333cf 100644
--- a/Source/CargaEDI/CargaEDI.drc
+++ b/Source/CargaEDI/CargaEDI.drc
@@ -12,7 +12,7 @@ STRINGTABLE
BEGIN
END
-/* C:\Archivos de programa\CodeGear\RAD Studio\5.0\Lib\WindowsXP.res */
+/* c:\archivos de programa\codegear\rad studio\5.0\Lib\WindowsXP.res */
/* C:\Varela_D2007\Source\CargaEDI\uCargaEDI.dfm */
/* C:\Varela_D2007\Source\CargaEDI\CargaEDI.res */
-/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf71.tmp */
+/* C:\Varela_D2007\Source\CargaEDI\CargaEDI.drf */
diff --git a/Source/Cliente/AdminPV.drc b/Source/Cliente/AdminPV.drc
index 4d4d2ed..5b22127 100644
--- a/Source/Cliente/AdminPV.drc
+++ b/Source/Cliente/AdminPV.drc
@@ -12,10 +12,10 @@ STRINGTABLE
BEGIN
END
-/* C:\Archivos de programa\CodeGear\RAD Studio\5.0\Lib\WindowsXP.res */
+/* c:\archivos de programa\codegear\rad studio\5.0\Lib\WindowsXP.res */
/* C:\Varela_D2007\Lib\JVCL\JvXPCore.res */
/* C:\Varela_D2007\Source\Cliente\uSplash.dfm */
/* C:\Varela_D2007\Source\Cliente\uAcercaDe.dfm */
/* C:\Varela_D2007\Source\Cliente\uPantallaPrincipal.dfm */
/* C:\Varela_D2007\Source\Cliente\AdminPV.res */
-/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf6F.tmp */
+/* C:\Varela_D2007\Source\Cliente\AdminPV.drf */
diff --git a/Source/Cliente/AdminPV.rc b/Source/Cliente/AdminPV.rc
index 4417beb..dc6db77 100644
--- a/Source/Cliente/AdminPV.rc
+++ b/Source/Cliente/AdminPV.rc
@@ -17,7 +17,7 @@ BEGIN
VALUE "InternalName", "Administración de puntos de venta\0"
VALUE "ProductName", "Administración de puntos de venta\0"
VALUE "ProductVersion", "1.0.0.0\0"
- VALUE "CompileDate", "jueves, 17 de abril de 2008 13:27\0"
+ VALUE "CompileDate", "miércoles, 23 de abril de 2008 16:58\0"
END
END
BLOCK "VarFileInfo"
diff --git a/Source/Cliente/AdminPV.res b/Source/Cliente/AdminPV.res
index 21509fe..c90bd3f 100644
Binary files a/Source/Cliente/AdminPV.res and b/Source/Cliente/AdminPV.res differ
diff --git a/Source/Cliente/uPantallaPrincipal.dfm b/Source/Cliente/uPantallaPrincipal.dfm
index 15731ba..27595b4 100644
--- a/Source/Cliente/uPantallaPrincipal.dfm
+++ b/Source/Cliente/uPantallaPrincipal.dfm
@@ -2,8 +2,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
Left = 358
Top = 250
Caption = 'Pantalla principal'
- ClientHeight = 453
- ClientWidth = 751
+ ClientHeight = 549
+ ClientWidth = 975
Color = clWindow
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
@@ -24,8 +24,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
object pnlContenido: TTBXAlignmentPanel
Left = 0
Top = 0
- Width = 751
- Height = 431
+ Width = 975
+ Height = 527
Margins.Left = 5
Margins.Top = 5
Margins.Right = 5
@@ -37,7 +37,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
Left = 215
Top = 5
Width = 5
- Height = 421
+ Height = 517
ResizeStyle = rsPattern
ExplicitLeft = 210
ExplicitHeight = 570
@@ -46,7 +46,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
Left = 5
Top = 5
Width = 210
- Height = 421
+ Height = 517
ActivePage = pagInicio
Align = alLeft
AutoHeaders = True
@@ -90,7 +90,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
Left = 0
Top = 0
Width = 208
- Height = 348
+ Height = 444
Background.Stretch = False
Background.Proportional = False
Background.Center = False
@@ -100,7 +100,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
ImageIndex = 0
object Panel1: TPanel
Left = 0
- Top = 262
+ Top = 358
Width = 208
Height = 86
Align = alBottom
@@ -153,8 +153,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
object pnlBorde: TJvXPContainer
Left = 220
Top = 5
- Width = 526
- Height = 421
+ Width = 750
+ Height = 517
BoundColor = clActiveCaption
BoundLines = [blLeft, blTop, blRight, blBottom]
Caption = 'pnlBorde'
@@ -162,8 +162,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
object pnlMain: TTBXAlignmentPanel
Left = 1
Top = 1
- Width = 524
- Height = 419
+ Width = 748
+ Height = 515
Align = alClient
Color = clWindow
TabOrder = 0
@@ -203,9 +203,9 @@ object fPantallaPrincipal: TfPantallaPrincipal
end
object TBXStatusBar1: TTBXStatusBar
Left = 0
- Top = 431
- Width = 751
- Images = StatusPanelImageList
+ Top = 527
+ Width = 975
+ Images = StatusBarImages
Panels = <
item
ImageIndex = 1
@@ -337,11 +337,6 @@ object fPantallaPrincipal: TfPantallaPrincipal
Top = 181
Bitmap = {}
end
- object ModulesActionList: TActionList
- Images = ModulesLargeImageList
- Left = 19
- Top = 180
- end
object ModulesLargeImageList: TPngImageList
Height = 24
Width = 24
@@ -563,7 +558,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
Left = 288
Top = 168
end
- object StatusPanelImageList: TPngImageList
+ object StatusBarImages: TPngImageList
PngImages = <
item
PngImage.Data = {
diff --git a/Source/Cliente/uPantallaPrincipal.pas b/Source/Cliente/uPantallaPrincipal.pas
index 8bc22b9..d5c817d 100644
--- a/Source/Cliente/uPantallaPrincipal.pas
+++ b/Source/Cliente/uPantallaPrincipal.pas
@@ -8,8 +8,7 @@ uses
JvNavigationPane, ImgList, Controls, PngImageList, Classes, ActnList, XPMan,
TBXStatusBars, JvXPCore, JvXPContainer, pngimage, ExtCtrls, StdCtrls,
JvPageList, JvExControls, JvExExtCtrls, JvSplitter, JvSyncSplitter,
- TBXDkPanels, uCustomEditor, uHostManager, uGUIBase,
- Dialogs;
+ TBXDkPanels, uCustomEditor, uHostManager, uGUIBase;
type
IMainForm = interface(IHostForm)
@@ -23,7 +22,6 @@ type
ModulesSmallImageList: TPngImageList;
XPManifest1: TXPManifest;
actSalir: TAction;
- ModulesActionList: TActionList;
ModulesLargeImageList: TPngImageList;
pnlContenido: TTBXAlignmentPanel;
JvNavigationPane: TJvNavigationPane;
@@ -50,7 +48,7 @@ type
lblBienvenido: TLabel;
Label22: TLabel;
TBXStatusBar1: TTBXStatusBar;
- StatusPanelImageList: TPngImageList;
+ StatusBarImages: TPngImageList;
Opciones1_OLD: TMenuItem;
Edicin1_OLD: TMenuItem;
N1: TMenuItem;
@@ -116,7 +114,7 @@ uses
uSplash, uAcercaDe, UxTheme, Themes, uMenuUtils,
uAdminPV_App, uDMBase,
uModuleController, uMainMenuController, uNavPaneController,
- uDialogUtils, cxControls;
+ uDialogUtils, cxControls, uClienteUtils;
{$R *.dfm}
@@ -309,9 +307,41 @@ begin
end;
procedure TfPantallaPrincipal.AplicarPerfil;
+var
+ AMenuItem : TMenuItem;
+ ASeccionCount : Integer;
+ AItemIndex : Integer;
+ ACaption : String;
begin
- Administracin1.Enabled := (AppAdminPV.UsuarioActivo.USERNAME = 'admin');
- Administracin1.Visible := Administracin1.Enabled;
+ // Si el usuario es administrador puede acceder a la parte de administración.
+ if not AppAdminPV.UsuariosController.EsAdministrador(AppAdminPV.UsuarioActivo) then
+ begin
+ Administracin1.Enabled := False;
+ Administracin1.Visible := False;
+ end;
+
+ // Guardar la lista de secciones (Ventas, Compras, etc...)
+ for ASeccionCount := 0 to Menu.Items.Count - 1 do
+ begin
+ AMenuItem := Menu.Items[ASeccionCount];
+
+ if not EsUnModulo(AMenuItem) then
+ Continue;
+
+ for AItemIndex := 0 to (AMenuItem.Count - 1) do
+ begin
+ if ((not AMenuItem[AItemIndex].IsLine) // que no sea una línea separadora
+ and (AMenuItem[AItemIndex].Count = 0)) // y que no sea el padre de un submenú
+ then
+ if Assigned(AMenuItem[AItemIndex].Action) then
+ with AppAdminPV.UsuariosController do
+ begin
+ ACaption := TAction(AMenuItem[AItemIndex].Action).Caption;
+ ACaption := StringReplace(ACaption, '&', '', []);
+ TAction(AMenuItem[AItemIndex].Action).Enabled := HayAccesoPermitido(ACaption);
+ end;
+ end;
+ end;
end;
procedure TfPantallaPrincipal.ApplicationEventsException(Sender: TObject;
@@ -324,7 +354,7 @@ begin
ShowMessage(E.Message);
end
else}
- ShowMessage(E.Message);
+ Application.ShowException(E);
//ShowErrorMessage('Se ha producido un error', '', E);
end;
diff --git a/Source/ControlesBase/ControlesBase.dpk b/Source/ControlesBase/ControlesBase.dpk
index 5a3235f..6cb6265 100644
--- a/Source/ControlesBase/ControlesBase.dpk
+++ b/Source/ControlesBase/ControlesBase.dpk
@@ -27,43 +27,43 @@ package ControlesBase;
{$DEFINE DEBUG}
requires
- rtl,
- vcl,
- PngComponentsD10,
- PNG_D10,
- dbrtl,
- dsnap,
- adortl,
- JvGlobusD11R,
- cxTreeListD10,
- vclactnband,
- vclx,
- tb2k_D10,
- tbx_D10,
- JvCoreD11R,
- vcljpg,
- Jcl,
- JclVcl,
- JvSystemD11R,
- JvPageCompsD11R,
- JvStdCtrlsD11R,
- dxThemeD10,
- cxLibraryD10,
- cxExportD10,
- cxEditorsD10,
- cxDataD10,
- vcldb,
- cxExtEditorsD10,
- cxGridD10,
- cxPageControlD10,
- dxLayoutControlD10,
- dxComnD10,
- cxVerticalGridD10,
- dxPSCoreD10,
- VclSmp,
- bdertl,
- EasyListviewD11,
- Base;
+ rtl,
+ vcl,
+ PngComponentsD10,
+ PNG_D10,
+ dbrtl,
+ dsnap,
+ adortl,
+ JvGlobusD11R,
+ cxTreeListD10,
+ vclactnband,
+ vclx,
+ tb2k_D10,
+ tbx_D10,
+ JvCoreD11R,
+ vcljpg,
+ Jcl,
+ JclVcl,
+ JvSystemD11R,
+ JvPageCompsD11R,
+ JvStdCtrlsD11R,
+ dxThemeD10,
+ cxLibraryD10,
+ cxExportD10,
+ cxEditorsD10,
+ cxDataD10,
+ vcldb,
+ cxExtEditorsD10,
+ cxGridD10,
+ cxPageControlD10,
+ dxLayoutControlD10,
+ dxComnD10,
+ cxVerticalGridD10,
+ dxPSCoreD10,
+ VclSmp,
+ bdertl,
+ EasyListviewD11,
+ Base;
contains
uEditorControlesBase in 'Cliente\uEditorControlesBase.pas' {fEditorControlesBase: TCustomEditor},
diff --git a/Source/ControlesBase/ControlesBase.dproj b/Source/ControlesBase/ControlesBase.dproj
index bdb5ca9..a8862c0 100644
--- a/Source/ControlesBase/ControlesBase.dproj
+++ b/Source/ControlesBase/ControlesBase.dproj
@@ -54,78 +54,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
CodeGear WebSnap Components
CodeGear SOAP Components
Microsoft Office XP Sample Automation Server Wrapper Components
@@ -140,7 +68,7 @@
MainSource
-
+
@@ -176,6 +104,59 @@
+
+
+ TDAClientDataModule
+
+
+
+ TCustomEditor
+
+
+
+ TCustomEditor
+
+
+
+
+
+
+ TCustomView
+
+
+
+ TCustomView
+
+
+
+ TCustomView
+
+
+
+ TCustomView
+
+
+
+ TCustomView
+
+
+
+ TCustomView
+
+
+
+ TCustomView
+
+
+
+ TCustomView
+
+
+
+ TCustomView
+
+
+