Permissions

Personas in this Story: Default, Member, ProjectManager, FinancialManager, Client.

Project budget can be set per project when time and expense tracking is enabled on that project. When enabled, ActiveCollab will provide a nice budget report which shows how much time and expenses is tracked, and how these numbers stand against set budget. In order to demonstrate how this works, we have one project defined:

Response: HTTP 200, application/json (Hide)
GET /projects/1

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
    "single": {
        "id": 1,
        "class": "Project",
        "url_path": "\/projects\/1",
        "name": "Budget test",
        "completed_on": null,
        "completed_by_id": null,
        "is_completed": false,
        "members": [
            1,
            2,
            3,
            4,
            5
        ],
        "category_id": 0,
        "label_id": 0,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164019,
        "created_by_id": 1,
        "updated_on": 1430164020,
        "updated_by_id": 1,
        "body": null,
        "body_formatted": "",
        "company_id": 1,
        "leader_id": 0,
        "currency_id": 2,
        "template_id": 0,
        "based_on_type": null,
        "based_on_id": null,
        "email": "notifications+m2p-fCVHafd@mail.manageprojects.com",
        "is_tracking_enabled": false,
        "is_client_reporting_enabled": false,
        "budget": null,
        "count_tasks": 0,
        "count_discussions": 0,
        "count_files": 0,
        "count_notes": 0
    },
    "category": null,
    "hourly_rates": {
        "1": 100
    },
    "label_ids": [],
    "task_lists": null
}

Because time and expense tracking is not enabled for this project, nobody can access the budget report:

Response: HTTP 404, text/html
GET /projects/1/budget
Response: HTTP 404, text/html
GET /projects/1/budget (as Member)
Response: HTTP 404, text/html
GET /projects/1/budget (as ProjectManager)
Response: HTTP 404, text/html
GET /projects/1/budget (as FinancialManager)
Response: HTTP 404, text/html
GET /projects/1/budget (as Client)

Lets enable time tracking and set a budget for this project:

Response: HTTP 200, application/json (Hide)
PUT /projects/1

Payload:

1
2
3
4
{
    "budget": 1000,
    "is_tracking_enabled": true
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
    "single": {
        "id": 1,
        "class": "Project",
        "url_path": "\/projects\/1",
        "name": "Budget test",
        "completed_on": null,
        "completed_by_id": null,
        "is_completed": false,
        "members": [
            1,
            2,
            3,
            4,
            5
        ],
        "category_id": 0,
        "label_id": 0,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164019,
        "created_by_id": 1,
        "updated_on": 1430164021,
        "updated_by_id": 1,
        "body": null,
        "body_formatted": "",
        "company_id": 1,
        "leader_id": 0,
        "currency_id": 2,
        "template_id": 0,
        "based_on_type": null,
        "based_on_id": null,
        "email": "notifications+m2p-fCVHafd@mail.manageprojects.com",
        "is_tracking_enabled": true,
        "is_client_reporting_enabled": false,
        "budget": 1000,
        "count_tasks": 0,
        "count_discussions": 0,
        "count_files": 0,
        "count_notes": 0
    },
    "category": null,
    "hourly_rates": {
        "1": 100
    },
    "label_ids": [],
    "task_lists": null
}

When we run /projects/:project_id/budget, we'll get a nice budget report:

Response: HTTP 200, application/json (Hide)
GET /projects/1/budget

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    "budget": 1000,
    "cost_so_far": 0,
    "billable_cost_so_far": 0,
    "non_billable_cost_so_far": 0,
    "cost_by_job_type": [
        {
            "id": 1,
            "rate": 100,
            "hours": 0,
            "value": 0,
            "non_billable_hours": 0,
            "non_billable_value": 0
        }
    ],
    "expenses": 0,
    "non_billable_expenses": 0
}
Response: HTTP 404, text/html
GET /projects/1/budget (as Member)
Response: HTTP 200, application/json (Hide)
GET /projects/1/budget (as ProjectManager)

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    "budget": 1000,
    "cost_so_far": 0,
    "billable_cost_so_far": 0,
    "non_billable_cost_so_far": 0,
    "cost_by_job_type": [
        {
            "id": 1,
            "rate": 100,
            "hours": 0,
            "value": 0,
            "non_billable_hours": 0,
            "non_billable_value": 0
        }
    ],
    "expenses": 0,
    "non_billable_expenses": 0
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/budget (as FinancialManager)

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    "budget": 1000,
    "cost_so_far": 0,
    "billable_cost_so_far": 0,
    "non_billable_cost_so_far": 0,
    "cost_by_job_type": [
        {
            "id": 1,
            "rate": 100,
            "hours": 0,
            "value": 0,
            "non_billable_hours": 0,
            "non_billable_value": 0
        }
    ],
    "expenses": 0,
    "non_billable_expenses": 0
}
Response: HTTP 404, text/html
GET /projects/1/budget (as Client)

Note that member and client still get 404. This is because members don't have access to project budgets unless they have permissions to create new projects or manage finances. Clients will be able to see this report only when client reporting is enabled for the projects. Lets do that now:

Response: HTTP 200, application/json (Hide)
PUT /projects/1

Payload:

1
2
3
{
    "is_client_reporting_enabled": true
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
    "single": {
        "id": 1,
        "class": "Project",
        "url_path": "\/projects\/1",
        "name": "Budget test",
        "completed_on": null,
        "completed_by_id": null,
        "is_completed": false,
        "members": [
            1,
            2,
            3,
            4,
            5
        ],
        "category_id": 0,
        "label_id": 0,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164019,
        "created_by_id": 1,
        "updated_on": 1430164021,
        "updated_by_id": 1,
        "body": null,
        "body_formatted": "",
        "company_id": 1,
        "leader_id": 0,
        "currency_id": 2,
        "template_id": 0,
        "based_on_type": null,
        "based_on_id": null,
        "email": "notifications+m2p-fCVHafd@mail.manageprojects.com",
        "is_tracking_enabled": true,
        "is_client_reporting_enabled": true,
        "budget": 1000,
        "count_tasks": 0,
        "count_discussions": 0,
        "count_files": 0,
        "count_notes": 0
    },
    "category": null,
    "hourly_rates": {
        "1": 100
    },
    "label_ids": [],
    "task_lists": null
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/budget (as Client)

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    "budget": 1000,
    "cost_so_far": 0,
    "billable_cost_so_far": 0,
    "non_billable_cost_so_far": 0,
    "cost_by_job_type": [
        {
            "id": 1,
            "rate": 100,
            "hours": 0,
            "value": 0,
            "non_billable_hours": 0,
            "non_billable_value": 0
        }
    ],
    "expenses": 0,
    "non_billable_expenses": 0
}