Skip to content

Add roles#1069

Merged
nscuro merged 48 commits into
DependencyTrack:mainfrom
ashearin:add-roles-model
Jun 4, 2025
Merged

Add roles#1069
nscuro merged 48 commits into
DependencyTrack:mainfrom
ashearin:add-roles-model

Conversation

@ashearin
Copy link
Copy Markdown
Contributor

@ashearin ashearin commented Feb 24, 2025

Description

This PR adds Roles and related model classes as well as Query Manager Changes as part of the effort to enforce permissions at the Project level.

Additional context/conversation can be found in the issue below.

Addressed Issue

Resolves DependencyTrack/hyades#1632

Needed for Gitlab Integration (Proposed Change) #1052

Related Frontend PR: DependencyTrack/hyades-frontend#283

Additional Details

All changes within persistence-jooq were auto-generated.

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

Comment thread src/main/java/org/dependencytrack/persistence/jdbi/RoleDao.java Outdated
Comment thread src/main/resources/migration/procedures/function_has-project-access.sql Outdated
Comment thread src/main/java/org/dependencytrack/persistence/QueryManager.java Outdated
Comment thread src/main/resources/migration/procedures/function_has-project-access.sql Outdated
@ashearin ashearin marked this pull request as ready for review May 20, 2025 15:30
ashearin added 4 commits May 23, 2025 14:19
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
jmayer-lm and others added 4 commits May 23, 2025 15:12
)

Signed-off-by: jmayer-lm <johnny.w.mayer.iii@lmco.com>
Signed-off-by: lmphil <126618132+lmphil@users.noreply.github.com>
Signed-off-by: jmayer-lm <johnny.w.mayer.iii@lmco.com>
Signed-off-by: EphraimEM <ephraim.e.mensah@lmco.com>
jhoward-lm and others added 13 commits May 23, 2025 15:25
Signed-off-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com>
Signed-off-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com>
Signed-off-by: lmphil <126618132+lmphil@users.noreply.github.com>
Signed-off-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com>
Signed-off-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com>
Signed-off-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com>
Signed-off-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com>
This reverts commit 44dd2a2.

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
…e changes (#18)

Signed-off-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com>
Signed-off-by: lmphil <126618132+lmphil@users.noreply.github.com>
Signed-off-by: lmphil <126618132+lmphil@users.noreply.github.com>
Signed-off-by: Alexis Lamb <alexis.lamb@lmco.com>
Signed-off-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com>
- chore: test cleanup
- chore: address PR comments

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Comment thread apiserver/src/main/java/org/dependencytrack/model/UserProjectRole.java Outdated
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 30, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.15% (target: -1.00%) 93.63% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8b53629) 27248 22178 81.39%
Head commit (9325a10) 27521 (+273) 22442 (+264) 81.55% (+0.15%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1069) 314 294 93.63%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

ashearin and others added 2 commits May 30, 2025 13:52
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Copy link
Copy Markdown
Contributor

@jhoward-lm jhoward-lm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor nitpicky to-dos for later

Comment thread apiserver/src/main/java/org/dependencytrack/resources/v1/PermissionResource.java Outdated
Comment thread apiserver/src/main/java/org/dependencytrack/resources/v1/PermissionResource.java Outdated
Comment thread apiserver/src/main/java/org/dependencytrack/resources/v1/PermissionResource.java Outdated
Comment thread apiserver/src/main/java/org/dependencytrack/resources/v1/RoleResource.java Outdated
Comment thread apiserver/src/main/java/org/dependencytrack/resources/v1/PermissionResource.java Outdated
jhoward-lm and others added 6 commits May 31, 2025 11:05
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Comment thread apiserver/src/main/java/org/dependencytrack/resources/v1/RoleResource.java Outdated
Comment thread apiserver/src/main/java/org/dependencytrack/resources/v1/UserResource.java Outdated
Comment thread persistence-migration/src/main/resources/migration/changelog-v5.6.0.xml Outdated
@nscuro nscuro added this to the 5.6.0 milestone Jun 2, 2025
ashearin and others added 3 commits June 2, 2025 08:33
- Deleted ununsed ProejctRowMapper class
- AccessControlResource response tweak, associated test updates
- log cleanup

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Copy link
Copy Markdown
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two tiny schema changes left, otherwise this is good to go.

Comment thread persistence-migration/src/main/resources/migration/changelog-v5.6.0.xml Outdated
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Comment thread persistence-migration/src/main/resources/migration/changelog-v5.6.0.xml Outdated
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
@nscuro nscuro merged commit 097001f into DependencyTrack:main Jun 4, 2025
9 checks passed
@jhoward-lm jhoward-lm deleted the add-roles-model branch June 4, 2025 14:04
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project-level RBAC

8 participants