Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

set role default value #416

Merged
merged 1 commit into from
Jun 12, 2023
Merged

set role default value #416

merged 1 commit into from
Jun 12, 2023

Conversation

anludke
Copy link
Contributor

@anludke anludke commented Jun 12, 2023

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story (FLPATH-xxxx):
Fixes #

Change type

  • New feature
  • Bug fix
  • Unit tests
  • Integration tests
  • CI
  • Documentation
  • Auto-generated SDK code

Impacted services

  • Workflow Service
  • Notification Service

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

@openshift-ci openshift-ci bot requested review from masayag and nirarg June 12, 2023 16:07
@anludke anludke requested a review from RichardW98 June 12, 2023 16:08
@openshift-ci
Copy link

openshift-ci bot commented Jun 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RichardW98

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Collaborator

@pkliczewski pkliczewski left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jun 12, 2023
@anludke anludke merged commit a13b6c5 into main Jun 12, 2023
@anludke anludke deleted the FLPATH-418-2 branch June 12, 2023 18:50
@@ -195,7 +195,7 @@ public AccessResponseDTO createAccessRequestToProject(UUID id, AccessRequestDTO
}
User user = userService.getUserEntityByUsername(accessRequestDTO.getUsername());
if (isNull(accessRequestDTO.getRole())) {
throw new ResourceNotFoundException("Role cannot be null");
accessRequestDTO.setRole(com.redhat.parodos.project.enums.Role.DEVELOPER);
Copy link
Contributor

Choose a reason for hiding this comment

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

May I ask why this is the correct default role?
Can you please document this behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OWNER, ADMIN and DEVELOPER are the 3 possible roles that a user can have in a project at the moment.
By default, DEVELOPER is used for an access request when the role is not provided in the request payload.
As the UI doesn't support or allow the requester to specify the role (ADMIN or DEVELOPER) for a user, DEVELOPER is currently used as default.
I'll open a PR today to document the entire behaviour :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the explanation!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants