Skip to content

Commit

Permalink
Merge pull request #360 from georchestra/fix-logger-acl
Browse files Browse the repository at this point in the history
Log a meaningful info message when use doesnt have enough rights inst…
  • Loading branch information
pierrejego authored Nov 16, 2017
2 parents fa10432 + a1221fe commit 44c299a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ public List<Map<String, Object>> infoOngletBatiment(@Context HttpHeaders headers
@QueryParam("dnubat") String dnubat){

List<Map<String, Object>> batiments = new ArrayList<Map<String, Object>>();

if(parcelle != null && !parcelle.isEmpty()
&& dnubat != null && !dnubat.isEmpty()
&& getUserCNILLevel(headers) > 1)
if (getUserCNILLevel(headers) == 0) {
logger.info("User does not have enough rights to see information about batiment");
}
else if(parcelle != null && !parcelle.isEmpty()
&& dnubat != null && !dnubat.isEmpty())
{
logger.debug("infoOngletBatiment - parcelle : " + parcelle + " for dnubat : " + dnubat);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public Map<String, Object> getHabitationDetails(@Context HttpHeaders headers,
List<String> queryParams = new ArrayList<String>();
queryParams.add(annee);
queryParams.add(invar);

if(annee != null && invar != null && getUserCNILLevel(headers) > 1)
if (getUserCNILLevel(headers) == 0) {
logger.info("User needs does not have enough rights to see habitation details");
}
else if(annee != null && invar != null)
{
habitationDesc.put("article40", getArticle40Details(queryParams));
habitationDesc.put("article50", getArticle50Details(queryParams));
Expand Down

0 comments on commit 44c299a

Please sign in to comment.