free

Pricing for this item
Logo - fungus.at: der.pilz

fungus.at: der.pilz

Part time developer, code fanboy, backend-freak, symfony-lover

Screenshot
Click to enlarge
A plugin, which allows to create readonly users, that can read times recorded for a special company.
Last update: 09 Aug 2019

This bundle adds a special admin screen where the role can be assigned to an existing Kimai user.

Imagine the following:

If you are a contract worker for some different customers and if you are using Kimai for time-tracking.

Than you can do it that way: Create in Kimai the different Companies: Comp1 and Comp2 Create the different Projects you are working on: ProjC1A and ProjC1B for Comp1, ProjC2A for Comp2 And record your times.

At the end of the month, you create a bill for Comp1 and Comp2 and send it to them. Now you wait for your money. But sometimes no money comes back, but some discussions will start: why do you charge that mouch for ProjC1A, why was adjusting the login-screen that expensive, why did you do that… and that…

So, what if you can create some other user-accounts in Kimai, lets say UserComp1 and UserComp2. And now you can assign UserComp1 to Comp1 and UserComp2 to Comp2.

With that user-accounts someone responsible at Company1 and Company2 can login into Kimai and track instantly your times. Because UserComp1 can see (and only see!!) the times entered for Company1 from anyone who can record some times in Kimai.

Wouldn’t that be great?

Permissions

This bundle ships a new administration screen, which will be available for the following users:

  • ROLE_SUPER_ADMIN - every super administrator
  • edit_readonly_user - every use that owns this permission

This bundle also ships a new user-screen, which is available for users that are configured in the new admin-screen.

Requires

Kimai 2, V1.1

Installation

Copy files

Extract the ZIP file and upload the included directory and all files to your Kimai installation to the new directory:

var/plugins/ReadOnlyAccessBundle/

Or you can clone it directly to the var/plugins/ directory of your Kimai installation:

cd kimai/var/plugins/
git clone https://github.com/fungus75/ReadOnlyAccessBundle.git

The file structure needs to like like this afterwards:

var/plugins/
├── ReadOnlyAccessBundle
│   ├── ReadOnlyAccessBundle.php
|   └ ... more files and directories follow here ...

Clear cache

After uploading the files, Kimai needs to know about the new plugin. It will be found once the cache was re-built. Call these commands from the Kimai directory:

How to reload Kimai cache

bin/console kimai:reload --env=prod

FTP users: please have a look at this documentation.

If you are running an older version of Kimai (before 1.8) you have to use:

bin/console cache:clear --env=prod
bin/console cache:warmup --env=prod

You might have to set file permissions afterwards:

Fix Kimai file permission

You have to allow PHP (your webserver process) to write to var/ and it subdirectories.

Here is an example for Debian/Ubuntu (to be executed inside the Kimai directory):

chown -R :www-data .
chmod -R g+r .
chmod -R g+rw var/
chmod -R g+rw public/avatars/

Test Kimai before executing these commands (they are likely not required in a shared-hosting environment). You probably need to prefix them with sudo and the group might be called different than www-data.

Updates

Updating the plugin works exactly like the installation:

  • Delete the directory var/plugins/ReadOnlyAccessBundle/
  • Execute all installation steps again:
    • Copy files
    • Clear cache

All items by fungus.at: der.pilz