Skip to content

Commit 755b13e

Browse files
Stefan ErnstStefan Ernst
authored andcommitted
Permission fixes and redesign after first pentest
- Eliminated user enumeration vector - Added new permissions to time customer & projects - Added attachment permissions - Removed permission set UI as this is not functional at the moment. Only default role permissions are supported at this time.
1 parent 84abf75 commit 755b13e

45 files changed

Lines changed: 2132 additions & 397 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

frontend/package-lock.json

Lines changed: 166 additions & 230 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
"@github/hotkey": "^3.1.1",
4949
"@melt-ui/pp": "^0.3.2",
5050
"@melt-ui/svelte": "^0.86.6",
51-
"@milkdown/components": "^7.17.2",
52-
"@milkdown/kit": "^7.17.2",
53-
"@milkdown/plugin-listener": "^7.17.2",
51+
"@milkdown/components": "^7.18.0",
52+
"@milkdown/kit": "^7.18.0",
53+
"@milkdown/plugin-listener": "^7.18.0",
5454
"@milkdown/theme-nord": "^7.18.0",
5555
"@tailwindcss/vite": "^4.1.11",
5656
"@xyflow/svelte": "^1.3.0",

frontend/src/lib/api/portal.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export const contactRoles = {
9999

100100
// Customer Organisations (requires customers.manage permission)
101101
export const customerOrganisations = {
102-
getAll: () => fetchAPI('/time/customers'),
102+
getAll: () => fetchAPI('/customer-organisations'),
103+
get: (id) => fetchAPI(`/customer-organisations/${id}`),
104+
create: (data) => fetchAPI('/customer-organisations', { method: 'POST', body: JSON.stringify(data) }),
105+
update: (id, data) => fetchAPI(`/customer-organisations/${id}`, { method: 'PUT', body: JSON.stringify(data) }),
106+
delete: (id) => fetchAPI(`/customer-organisations/${id}`, { method: 'DELETE' }),
103107
getContacts: (id) => fetchAPI(`/customer-organisations/${id}/contacts`),
108+
getProjects: (id) => fetchAPI(`/customer-organisations/${id}/projects`),
104109
};

frontend/src/lib/api/time.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
import { fetchAPI } from './core.js';
22

33
export const time = {
4-
customers: {
5-
getAll: () => fetchAPI('/time/customers'),
6-
get: (id) => fetchAPI(`/time/customers/${id}`),
7-
create: (data) => fetchAPI('/time/customers', {
8-
method: 'POST',
9-
body: JSON.stringify(data),
10-
}),
11-
update: (id, data) => fetchAPI(`/time/customers/${id}`, {
12-
method: 'PUT',
13-
body: JSON.stringify(data),
14-
}),
15-
delete: (id) => fetchAPI(`/time/customers/${id}`, {
16-
method: 'DELETE',
17-
}),
18-
getProjects: (id) => fetchAPI(`/time/customers/${id}/projects`),
19-
},
20-
214
projectCategories: {
225
getAll: () => fetchAPI('/time/project-categories'),
236
get: (id) => fetchAPI(`/time/project-categories/${id}`),
@@ -54,6 +37,26 @@ export const time = {
5437
method: 'DELETE',
5538
}),
5639
getWorklogs: (id) => fetchAPI(`/time/projects/${id}/worklogs`),
40+
41+
// Project Managers
42+
getManagers: (id) => fetchAPI(`/time/projects/${id}/managers`),
43+
addManager: (id, managerType, managerId) => fetchAPI(`/time/projects/${id}/managers`, {
44+
method: 'POST',
45+
body: JSON.stringify({ manager_type: managerType, manager_id: managerId }),
46+
}),
47+
removeManager: (id, managerId) => fetchAPI(`/time/projects/${id}/managers/${managerId}`, {
48+
method: 'DELETE',
49+
}),
50+
51+
// Project Members
52+
getMembers: (id) => fetchAPI(`/time/projects/${id}/members`),
53+
addMember: (id, memberType, memberId) => fetchAPI(`/time/projects/${id}/members`, {
54+
method: 'POST',
55+
body: JSON.stringify({ member_type: memberType, member_id: memberId }),
56+
}),
57+
removeMember: (id, memberId) => fetchAPI(`/time/projects/${id}/members/${memberId}`, {
58+
method: 'DELETE',
59+
}),
5760
},
5861

5962
worklogs: {

frontend/src/lib/dialogs/IterationModal.svelte

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@
219219
</div>
220220
221221
</form>
222-
223-
<DialogFooter
224-
onCancel={handleCancel}
225-
onConfirm={handleSave}
226-
confirmLabel={iteration ? t('sprints.updateIteration') : t('sprints.createIteration')}
227-
disabled={saving}
228-
loading={saving}
229-
showKeyboardHint={true}
230-
confirmKeyboardHint={submitHint}
231-
/>
232222
</div>
223+
224+
<DialogFooter
225+
onCancel={handleCancel}
226+
onConfirm={handleSave}
227+
confirmLabel={iteration ? t('sprints.updateIteration') : t('sprints.createIteration')}
228+
disabled={saving}
229+
loading={saving}
230+
showKeyboardHint={true}
231+
confirmKeyboardHint={submitHint}
232+
/>
233233
</Modal>

frontend/src/lib/dialogs/RequestTypeVisibilityModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
// Load groups and organisations in parallel
3737
const [groupsData, orgsData] = await Promise.all([
3838
api.groups.getAll(),
39-
api.time.customers.getAll()
39+
api.customerOrganisations.getAll()
4040
]);
4141
groups = groupsData || [];
4242
organisations = orgsData || [];

0 commit comments

Comments
 (0)