Skip to content

Commit

Permalink
Add docs about user permissions when using docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtrek14 authored and anarute committed Aug 17, 2023
1 parent e9c4759 commit d71317f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/src/developer/devel-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,40 @@ To create migrations:
All the services are setup to reload when the files are updated without the need
of rebuild the containers.

If you are using an external OAuth provider, you will also need to add a user to
the database with the same username as your OAuth user because PhpReport will
match on the username. To do this, you will want to run the following commands
once your db container is up and running:

```
docker exec -ti phpreport-db bash
psql -U phpreport
INSERT INTO usr (id, password, login) VALUES (DEFAULT, md5('myusername'), 'myusername') RETURNING id;
```

This will echo the id of the user you just created. Keep this terminal open. Now
you will need to also add some permissions to your user. To do this you'll need
to insert the user id into the `belongs` table along with the proper group id.
The default group ids added are as follows:

| id | name |
| -- | ----- |
| 1 | staff |
| 2 | admin |
| 3 | manager |

If you want your user to have the highest permission level, then run the
following and replace `{your user id}` with the value returned when you inserted
your user: `INSERT into belongs VALUES(1, {your user id}), (2, {your user id}),
(3, {your user id});`

If you want your user to have lower permissions, then remove whichever groups
from your INSERT statement you don't want your user in.

If you've given your user the highest permissions, then you'll be able to use
the interface to create clients and projects to use for creating tasks.


## Dependencies

Follow the corresponding section from the [installation
Expand Down

0 comments on commit d71317f

Please sign in to comment.