Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
103 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
sigla-web/src/main/java/it/cnr/contab/web/rest/config/SIGLASecurityContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package it.cnr.contab.web.rest.config; | ||
|
||
import it.cnr.contab.utenze00.bp.CNRUserContext; | ||
|
||
import java.security.Principal; | ||
|
||
import javax.ws.rs.container.ContainerRequestContext; | ||
import javax.ws.rs.core.SecurityContext; | ||
|
||
public class SIGLASecurityContext implements SecurityContext { | ||
|
||
private static final String X_SIGLA_CD_CDR = "X-sigla-cd-cdr"; | ||
private static final String X_SIGLA_CD_CDS = "X-sigla-cd-cds"; | ||
private static final String X_SIGLA_CD_UNITA_ORGANIZZATIVA = "X-sigla-cd_unita-organizzativa"; | ||
private static final String X_SIGLA_ESERCIZIO = "X-sigla-esercizio"; | ||
private final CNRUserContext userContext; | ||
|
||
public SIGLASecurityContext(ContainerRequestContext requestContext, String userName) | ||
{ | ||
this.userContext = new CNRUserContext( | ||
userName, | ||
null, | ||
Integer.valueOf(requestContext.getHeaderString(X_SIGLA_ESERCIZIO)), | ||
requestContext.getHeaderString(X_SIGLA_CD_UNITA_ORGANIZZATIVA), | ||
requestContext.getHeaderString(X_SIGLA_CD_CDS), | ||
requestContext.getHeaderString(X_SIGLA_CD_CDR) | ||
); | ||
} | ||
|
||
public Principal getUserPrincipal() | ||
{ | ||
return userContext; | ||
} | ||
|
||
public boolean isUserInRole(String role) | ||
{ | ||
return true; | ||
} | ||
|
||
public boolean isSecure() | ||
{ | ||
return true; | ||
} | ||
|
||
public String getAuthenticationScheme() | ||
{ | ||
return "SIGLA Security Context"; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...b/web/rest/config/MassimaleSpesaBulk.java → ...ab/web/rest/model/MassimaleSpesaBulk.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 0 additions & 70 deletions
70
sigla-web/src/main/java/it/cnr/contab/web/rest/model/UserContextBulk.java
This file was deleted.
Oops, something went wrong.