Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dda-front
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Francisco Montiel Jimenez
dda-front
Commits
52ff46a4
Commit
52ff46a4
authored
Sep 25, 2024
by
Jose Francisco Montiel Jimenez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
primeros cambios de permisos
parent
7cb3d3d0
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
188 additions
and
33 deletions
+188
-33
front/src/main/java/com/mx/dla/configuration/AuthInterceptor.java
...c/main/java/com/mx/dla/configuration/AuthInterceptor.java
+24
-0
front/src/main/java/com/mx/dla/dda/contrato/generales/actions/ObtenerPermisosAction.java
...dda/contrato/generales/actions/ObtenerPermisosAction.java
+30
-0
front/src/main/webapp/js/common/perfil/perfilController.js
front/src/main/webapp/js/common/perfil/perfilController.js
+5
-2
front/src/main/webapp/js/common/perfil/perfilService.js
front/src/main/webapp/js/common/perfil/perfilService.js
+3
-2
front/src/main/webapp/js/dda/contrato/transaccion/fees/estController.js
.../webapp/js/dda/contrato/transaccion/fees/estController.js
+1
-0
front/src/main/webapp/js/dda/contrato/transaccion/fees/feesUpload.js
...ain/webapp/js/dda/contrato/transaccion/fees/feesUpload.js
+5
-0
front/src/main/webapp/jsp/dda/contrato/transaccion/terminos/fees.jsp
...ain/webapp/jsp/dda/contrato/transaccion/terminos/fees.jsp
+3
-0
front/src/main/webapp/jsp/dda/contrato/transaccion/terminos/terminos.jsp
...webapp/jsp/dda/contrato/transaccion/terminos/terminos.jsp
+28
-25
front/src/main/webapp/jsp/errorGeneral.jsp
front/src/main/webapp/jsp/errorGeneral.jsp
+3
-3
front/src/main/webapp/jsp/errorPermiso.jsp
front/src/main/webapp/jsp/errorPermiso.jsp
+86
-0
persistencia/src/main/resources/mappers/admin/MenuDAO.xml
persistencia/src/main/resources/mappers/admin/MenuDAO.xml
+0
-1
No files found.
front/src/main/java/com/mx/dla/configuration/AuthInterceptor.java
0 → 100644
View file @
52ff46a4
package
com.mx.dla.configuration
;
import
com.opensymphony.xwork2.ActionInvocation
;
import
com.opensymphony.xwork2.interceptor.AbstractInterceptor
;
import
com.opensymphony.xwork2.ActionContext
;
import
java.util.Map
;
public
class
AuthInterceptor
extends
AbstractInterceptor
{
@Override
public
String
intercept
(
ActionInvocation
invocation
)
throws
Exception
{
System
.
out
.
println
(
"Entro"
);
//return "accessDenied";
//}
// Continuar con el flujo normal si los permisos son vlidos
return
invocation
.
invoke
();
}
}
front/src/main/java/com/mx/dla/dda/contrato/generales/actions/ObtenerPermisosAction.java
View file @
52ff46a4
...
...
@@ -24,6 +24,7 @@ public class ObtenerPermisosAction extends BaseContratoAction {
private
List
<
PermisoDTO
>
permisos
;
private
AreaDTO
area
;
private
UsuarioDTO
usuario
;
private
Integer
permisoSi
;
@Autowired
private
GeneralesBO
generalesBO
;
...
...
@@ -46,8 +47,27 @@ public class ObtenerPermisosAction extends BaseContratoAction {
throw
new
TransaccionException
(
"Ocurrio un error"
,
e
);
}
setPermisos
(
permisosS
);
if
(!
getPmn
().
equals
(
"1"
))
{
if
(
tienePermiso
(
permisosS
,
getPmn
()))
{
//System.out.println("Tiene permiso para " + getPmn());
permisoSi
=
1
;
}
else
{
//System.out.println("No tiene permiso para " + getPmn());
logger
.
error
(
"El usuario no tiene el permiso. {}"
,
getPmn
());
permisoSi
=
0
;
}
}
return
SUCCESS
;
}
private
boolean
tienePermiso
(
List
<
PermisoDTO
>
permisos
,
String
id
)
{
for
(
PermisoDTO
permiso
:
permisos
)
{
if
(
permiso
.
getIdMenu
().
toString
().
equals
(
id
))
{
return
true
;
}
}
return
false
;
}
public
void
setPermisos
(
List
<
PermisoDTO
>
permisos
)
{
this
.
permisos
=
permisos
;
...
...
@@ -72,4 +92,14 @@ public class ObtenerPermisosAction extends BaseContratoAction {
public
UsuarioDTO
getUsuario
()
{
return
usuario
;
}
public
Integer
getPermisoSi
()
{
return
permisoSi
;
}
public
void
setPermisoSi
(
Integer
permisoSi
)
{
this
.
permisoSi
=
permisoSi
;
}
}
front/src/main/webapp/js/common/perfil/perfilController.js
View file @
52ff46a4
...
...
@@ -417,10 +417,11 @@ function PerfilController() {
}
//ejecuta obtenerprmisos.action_________________________________
PerfilController
.
prototype
.
ejecutarPerfil
=
function
(
pmn
)
{
var
data
=
this
.
perfilService
.
obtenerPermisos
();
var
data
=
this
.
perfilService
.
obtenerPermisos
(
pmn
);
var
vpermisos
=
data
.
permisos
;
var
varea
=
data
.
area
;
var
vusuario
=
data
.
usuario
;
var
permisoSi
=
data
.
permisoSi
//INICIAN permisos para Carga Transacciones y Promociones...
...
...
@@ -435,7 +436,9 @@ PerfilController.prototype.ejecutarPerfil = function(pmn) {
$
(
"
#pEliminarFalse
"
).
css
(
"
display
"
,
"
block
"
);
$
(
"
#pDetalleTrue
"
).
css
(
"
display
"
,
"
none
"
);
$
(
"
#pDetalleFalse
"
).
css
(
"
display
"
,
"
block
"
);
if
(
permisoSi
===
0
){
window
.
location
.
href
=
'
/dla/jsp/errorPermiso.jsp
'
;
}
for
(
var
A
=
0
;
A
<
vpermisos
.
length
;
A
++
){
//transacciones
...
...
front/src/main/webapp/js/common/perfil/perfilService.js
View file @
52ff46a4
function
PerfilService
()
{
}
PerfilService
.
prototype
.
obtenerPermisos
=
function
()
{
var
jsonString
=
'
{"idContrato" : "
'
+
1
+
'
"}
'
;
//falta verificar si es necesario enviar algo
PerfilService
.
prototype
.
obtenerPermisos
=
function
(
pmn
)
{
var
jsonString
=
'
{"idContrato" : "
'
+
1
+
'
"
, "pmn" : "
'
+
pmn
+
'
"
}
'
;
//falta verificar si es necesario enviar algo
var
data
=
JSON
.
parse
(
jsonString
);
var
resp
=
{};
this
.
ajaxCall
(
"
obtenerPermisos
"
,
data
,
function
(
response
)
{
resp
=
response
;
});
...
...
@@ -16,6 +16,7 @@ PerfilService.prototype.ajaxCall = function(action, data, success) {
data
:
data
,
async
:
false
,
success
:
function
(
response
)
{
console
.
log
(
response
);
success
(
response
);
//se puede definir un unsuccess apartir de la respuesta del action
},
...
...
front/src/main/webapp/js/dda/contrato/transaccion/fees/estController.js
View file @
52ff46a4
var
uploaderEst
=
new
UploaderEX
(
"
cargaFeesDivEst
"
);
//Se crear el objeto para cargar archivos
var
datosSubirEst
=
null
;
var
perfil
;
...
...
front/src/main/webapp/js/dda/contrato/transaccion/fees/feesUpload.js
View file @
52ff46a4
$
().
ready
(
function
()
{
var
perfilController
=
new
PerfilController
();
perfilController
.
ejecutarPerfil
(
"
26
"
);
});
function
UploaderEX
(
divUploader
)
{
...
...
front/src/main/webapp/jsp/dda/contrato/transaccion/terminos/fees.jsp
View file @
52ff46a4
...
...
@@ -109,5 +109,8 @@
<script
type=
"text/javascript"
language=
"javascript"
src=
"${contextPath}/js/dda/contrato/transaccion/fees/feesValidateService.js"
></script>
<script
type=
"text/javascript"
language=
"javascript"
src=
"${contextPath}/js/dda/contrato/transaccion/comun/tablaService.js"
></script>
<script
src=
"${contextPath}/js/common/perfil/perfilService.js?v=${versionJS}"
></script>
<script
src=
"${contextPath}/js/common/perfil/perfilController.js?v=${versionJS}"
></script>
<%@include
file=
"/jsp/common/defaultBottomLogin.jsp"
%>
\ No newline at end of file
front/src/main/webapp/jsp/dda/contrato/transaccion/terminos/terminos.jsp
View file @
52ff46a4
...
...
@@ -57,7 +57,8 @@
.tdEditable
{
min-width
:
60px
;
}
}
</style>
<script
type=
"text/javascript"
>
...
...
@@ -88,20 +89,19 @@ $(document).ready(function() {
<div
class=
"container"
ng-controller=
"terminosController"
>
<jsp:include
page=
"/jsp/dda/contrato/transaccion/terminos/secciones/terminosModales.jsp"
/>
<div
class=
"row"
>
<div
class=
"form-inline"
>
<div
class=
"form-group col-sm-1"
>
<label>
Fecha del Contrato
</label>
<div
class=
"form-group"
>
<div
class=
"row"
>
<div
class=
"col-sm-3"
>
<label
class=
"control-label"
>
Fecha del Contrato
</label>
</div>
<div
class=
"
form-group col-sm-4
"
>
<div
class=
"
col-sm-3
"
>
<input
type=
"text"
class=
"form-control"
id=
"fechaInicioCto"
ng-model=
"fechaInicioCto"
value=
"{{fechaInicioCto}}"
readonly=
"readonly"
>
<input
type=
"text"
class=
"form-control"
id=
"fechaFinCto"
ng-model=
"fechaFinCto"
value=
"{{fechaFinCto}}"
readonly=
"readonly"
/>
</div>
<div
class=
"
form-group col-sm-1
"
>
<label>
Tipo de Cambio
</label>
<div
class=
"
col-sm-3
"
>
<label
class=
"control-label"
>
Tipo de Cambio
</label>
</div>
<div
class=
"
form-group
col-sm-3"
>
<div
class=
"col-sm-3"
>
<select
name=
"tipoCambio"
id=
"tipoCambio"
ng-model=
"tipoCambio"
>
<option
ng-repeat=
"option in tiposCambio"
...
...
@@ -111,12 +111,15 @@ $(document).ready(function() {
</select>
</div>
<div
class=
"form-group col-sm-1"
>
<label>
Inflacin
</label>
</div>
<br>
<div
class=
"row"
>
<div
class=
"col-sm-3"
>
<label
class=
"control-label"
>
Inflacin
</label>
</div>
<div
class=
"
form-group col-sm-1
"
>
<div
class=
"
col-sm-3
"
>
<input
type=
"text"
id=
"inflacionTx"
ng-model=
"inflacion"
class=
"form-control"
/>
</div>
</div>
</div>
</div>
...
...
@@ -125,17 +128,17 @@ $(document).ready(function() {
<nav
class=
"navbar navbar-default col-sm-9"
"
>
<div
class=
"navbar-inner "
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
data-bs-toggle=
"tab"
href=
"#home"
ng-click=
"inicializarPremium()"
>
Premium (Type 1)
</a></li>
<li>
<a
data-bs-toggle=
"tab"
href=
"#menu1"
ng-click=
"inicializarPremier()"
>
Premier (Type 1)
</a></li>
<li>
<a
data-bs-toggle=
"tab"
href=
"#menu2"
ng-click=
"inicializarLibreria()"
>
Librera (Type 2)
</a></li>
<li>
<a
data-bs-toggle=
"tab"
href=
"#menu3"
ng-click=
"inicializarMovies()"
>
Premier (EST 1) / Librera (EST 2)
</a></li>
<li>
<a
data-bs-toggle=
"tab"
href=
"#menu4"
ng-click=
"inicializarSeries()"
>
EPISODIOS DE SERIE (EST 8)
</a></li>
</ul>
</div>
</
na
v>
<div
class=
"row
"
>
<div
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
data-bs-toggle=
"tab"
href=
"#home"
ng-click=
"inicializarPremium()"
>
Premium (Type 1)
</a></li>
<li>
<a
data-bs-toggle=
"tab"
href=
"#menu1"
ng-click=
"inicializarPremier()"
>
Premier (Type 1)
</a></li>
<li>
<a
data-bs-toggle=
"tab"
href=
"#menu2"
ng-click=
"inicializarLibreria()"
>
Librera (Type 2)
</a></li>
<li>
<a
data-bs-toggle=
"tab"
href=
"#menu3"
ng-click=
"inicializarMovies()"
>
Premier (EST 1) / Librera (EST 2)
</a></li>
<li>
<a
data-bs-toggle=
"tab"
href=
"#menu4"
ng-click=
"inicializarSeries()"
>
EPISODIOS DE SERIE (EST 8)
</a></li>
</ul>
</div>
</
di
v>
<br/>
...
...
front/src/main/webapp/jsp/errorGeneral.jsp
View file @
52ff46a4
...
...
@@ -78,9 +78,9 @@
</div>
<script>
function
goBack
()
{
window
.
history
.
back
()
;
}
function
goBack
()
{
window
.
location
.
href
=
'
/dla/inicio.action
'
;
}
</script>
</body>
</html>
front/src/main/webapp/jsp/errorPermiso.jsp
0 → 100644
View file @
52ff46a4
<!DOCTYPE html >
<%@ page
language=
"java"
contentType=
"text/html; charset=iso-8859-1"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/fmt"
prefix=
"fmt"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/functions"
prefix=
"fn"
%>
<%@ taglib
uri=
"/WEB-INF/struts-tags.tld"
prefix=
"s"
%>
<%@ taglib
uri=
"http://www.springframework.org/security/tags"
prefix=
"sec"
%>
<c:set
var=
"contextPath"
value=
"
${
pageContext
.
request
.
contextPath
}
"
scope=
"request"
/>
<html>
<head>
<title>
Error
</title>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EDGE"
>
<%@include
file=
"/jsp/common/scripts.jsp"
%>
<%@include
file=
"/jsp/common/styles.jsp"
%>
<style>
body
{
font-family
:
Arial
,
sans-serif
;
text-align
:
center
;
padding
:
50px
;
background-color
:
#f8f9fa
;
}
.error-container
{
background-color
:
#fff
;
border
:
1px
solid
#dee2e6
;
border-radius
:
5px
;
box-shadow
:
0
0
10px
rgba
(
0
,
0
,
0
,
0.1
);
padding
:
20px
;
display
:
inline-block
;
}
.error-message
{
color
:
#dc3545
;
font-size
:
24px
;
margin-bottom
:
20px
;
}
.error-description
{
color
:
#6c757d
;
font-size
:
18px
;
}
.back-button
{
background-color
:
red
;
color
:
white
;
border
:
none
;
padding
:
10px
20px
;
text-align
:
center
;
text-decoration
:
none
;
display
:
inline-block
;
font-size
:
16px
;
margin
:
4px
2px
;
cursor
:
pointer
;
border-radius
:
4px
;
}
.back-button
:hover
{
background-color
:
darkred
;
}
.container
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
height
:
10vh
;
text-align
:
center
;
}
</style>
</head>
<body>
<div
class=
"error-container"
>
<div
class=
"error-message"
>
No tiene permiso de acceso a esta secci
ó
n.
</div>
<div
class=
"error-description"
>
Por favor, solicite los permisos con el administrador.
</div>
</div>
<div
class=
"container"
>
<button
class=
"back-button"
onclick=
"goBack()"
>
Regresar
</button>
</div>
<script>
function
goBack
()
{
window
.
location
.
href
=
'
/dla/inicio.action
'
;
}
</script>
</body>
</html>
persistencia/src/main/resources/mappers/admin/MenuDAO.xml
View file @
52ff46a4
...
...
@@ -68,7 +68,6 @@
DLA_C_PERFIL_MENU cpm, DLA_C_MENU cm
WHERE cpm.ID_MENU = cm.ID_MENU
AND cpm.ID_PERFIL = #{idPerfil}
AND cm.TIPO_MENU = 0
AND cm.ESTATUS = 1
ORDER BY cpm.ID_MENU
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment