tobybatch / kimai2

Docker containers for the kimai2 web application including docker-compose and kubernetes/helm deployment.
MIT License
181 stars 96 forks source link

[BUG] Rate visible in Export, Rate and Internal Rate visible in Print Export #368

Closed DerpgonCz closed 2 years ago

DerpgonCz commented 2 years ago

Describe the bug Even though a user should not be able to view his own rates (neither rate nor internal rate), it is visible in default Export view next to tasks, and subsequently in Print view.

To Reproduce Steps to reproduce the behaviour:

  1. Use these permissions for User:
    • edit_rate_other_timesheet: No
    • view_rate_other_timesheet: No
    • edit_rate_own_timesheet: No
    • view_rate_own_timesheet: No
    • hourly-rate_other_profile: No
    • hourly-rate_own_profile: No
  2. Allow create_export for User
  3. Create a Customer + Project + Activity
  4. Set User's Rate and Internal Rate for created Project
  5. Let User create a Timesheet (with start and end)
  6. Let User navigate to Export
  7. Observe
    • Total price is visible to the user (Rate*time)
    • Rate and Internal Rate are visible when navigating to Print view (click green Print bt

Desktop (please complete the following information):

Command used to run the container

Docker compose file (with passwords redacted)

version: '3.4'

networks:
  timetrack:
  traefik:
    external: true

x-defaults: &defaults
  restart: ${DOCKER_RESTART_POLICY}
  logging:
    driver: "json-file"
    options:
      max-file: "10"
      max-size: "10m"

services:
  kimai:
    <<: *defaults
    container_name: ${APP_ID}-kimai
    image: ${DOCKER_KIMAI_IMAGE}
    labels:
      - "traefik.enable=true"
      - "cz.softcake.app=${APP_KIMAI_SUBDOMAIN}"
      - "traefik.http.routers.${APP_ID}-kimai-rtr.tls=true"
      - "traefik.http.routers.${APP_ID}-kimai-rtr.entrypoints=http,https"
      - "traefik.http.services.${APP_ID}-kimai-svc.loadbalancer.server.port=8001"
    environment:
      - DATABASE_URL=mysql://${MYSQL_USERNAME}:${MYSQL_PASSWORD}@${APP_ID}-mysql:3306/${MYSQL_DATABASE}
      - TRUSTED_HOSTS=127.0.0.1,172.18.0.0/16,localhost,${APP_KIMAI_SUBDOMAIN}.${APP_DOMAIN}
      - TRUSTED_PROXIES=127.0.0.1,172.18.0.0/16,localhost,${APP_KIMAI_SUBDOMAIN}.${APP_DOMAIN}
      - APP_ENV=production
    volumes:
      - ./data/kimai:/opt/kimai/public
      - ./config/kimai/local.yaml:/opt/kimai/config/packages/local.yaml
    networks:
      - traefik
      - timetrack
    depends_on:
      - db

  db:
    <<: *defaults
    container_name: ${APP_ID}-mysql
    hostname: ${APP_ID}-mysql
    image: ${DOCKER_MYSQL_IMAGE}
    command: "mysqld --default-authentication-plugin=mysql_native_password --default-storage-engine innodb"
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_USER=${MYSQL_USERNAME}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
    volumes:
      - ./data/mysql:/var/lib/mysql
    networks:
      - timetrack

**.env File:***

APP_ID=softcake-cz-timetrack
APP_DOMAIN=softcake.cz
APP_KIMAI_SUBDOMAIN=timetrack

DOCKER_RESTART_POLICY=unless-stopped
DOCKER_KIMAI_IMAGE=kimai/kimai2:apache-1.19.1-prod
DOCKER_MYSQL_IMAGE=mysql:8.0.23

# MySQL
MYSQL_ROOT_PASSWORD=REDACTED
MYSQL_USERNAME=REDACTED
MYSQL_PASSWORD=REDACTED
MYSQL_DATABASE=REDACTED
kevinpapst commented 2 years ago

This is clearly documented: https://www.kimai.org/documentation/export.html

Bildschirmfoto 2022-04-04 um 12 54 15

BTW: this repo is only for docker related questions. Come to the official repo for Kimai questions: https://github.com/kevinpapst/kimai2