Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policy editor should support displaying roles with upper and lower case rolecodes #12080

Closed
nkylstad opened this issue Jan 19, 2024 · 5 comments · Fixed by #12247
Closed

Policy editor should support displaying roles with upper and lower case rolecodes #12080

nkylstad opened this issue Jan 19, 2024 · 5 comments · Fixed by #12247
Labels
added-to-sprint area/authorization Area: Issues related to roles and rights on apps, such as who can instantiate, sign etc. kind/bug Used when there is a defect / something is not working as it should.

Comments

@nkylstad
Copy link
Member

Description of the bug

Policies can ship with both upper- and lowercase role codes.
However, at the moment, only lowercase role codes from the policy are displayed with the descriptive text for the role. The same role code in uppercase results in just the rolecode being displayed.

Steps To Reproduce

  1. Create a new app
  2. Open settings modal for the app and go to "Tilgangsregler"
  3. See that roles REGNA and DAGL are displayed with role code
  4. Add a new role
  5. See that it is displayed with a display text rather than the role code.
    image

Additional Information

Probably introduced with #11545, therefore adding it to our current sprint.

@nkylstad nkylstad added kind/bug Used when there is a defect / something is not working as it should. status/triage area/authorization Area: Issues related to roles and rights on apps, such as who can instantiate, sign etc. added-to-sprint and removed status/triage labels Jan 19, 2024
@framitdavid framitdavid removed their assignment Feb 4, 2024
@ghost ghost self-assigned this Feb 5, 2024
@ghost ghost mentioned this issue Feb 5, 2024
3 tasks
@ghost ghost linked a pull request Feb 5, 2024 that will close this issue
3 tasks
@ghost ghost removed their assignment Feb 5, 2024
@framitdavid framitdavid assigned framitdavid and ghost and unassigned framitdavid Feb 6, 2024
@ghost ghost removed their assignment Feb 6, 2024
@ghost ghost assigned ghost and unassigned framitdavid and ghost Feb 12, 2024
@ghost ghost closed this as completed in #12247 Feb 14, 2024
@standeren standeren self-assigned this Feb 15, 2024
@standeren
Copy link
Contributor

Jeg har testet dette å endre på rollene for ulike apper nå, og usikker på om det har noe med denne PRen å gjøre ettersom det er en backend feil, men får hvertfall 500 server error når jeg legger til eller fjerner en hvilken som helst rolle 🤔
Har testet både lokalt og på dev.

Dette er konsollen lokalt:

System.NullReferenceException: Object reference not set to an instance of an object.
         at Altinn.Studio.PolicyAdmin.PolicyConverter.GetSubjectAnyOfs(List`1 subjects) in /Users/andreastanderen/Development/DigDir/altinn-studio/backend/PolicyAdmin/PolicyConverter.cs:line 251

@standeren standeren assigned ghost and unassigned standeren Feb 15, 2024
@ghost ghost assigned framitdavid and unassigned ghost Feb 15, 2024
@framitdavid
Copy link
Collaborator

Jeg har testet dette å endre på rollene for ulike apper nå, og usikker på om det har noe med denne PRen å gjøre ettersom det er en backend feil, men får hvertfall 500 server error når jeg legger til eller fjerner en hvilken som helst rolle 🤔 Har testet både lokalt og på dev.

Dette er konsollen lokalt:

System.NullReferenceException: Object reference not set to an instance of an object.
         at Altinn.Studio.PolicyAdmin.PolicyConverter.GetSubjectAnyOfs(List`1 subjects) in /Users/andreastanderen/Development/DigDir/altinn-studio/backend/PolicyAdmin/PolicyConverter.cs:line 251

Fixed in this PR 12316

@ghost ghost assigned ghost and unassigned framitdavid Feb 16, 2024
@ghost
Copy link

ghost commented Feb 16, 2024

Tested this in dev now, and there is still some errors. When a subject is selected from the combobox, and then removed from the list of selected subjects, the subjectid is present in the options list instead of the subject title. I guess that there there is one more usage where we use the title and id wrong in the code 🤔

Skjermopptak.2024-02-16.kl.12.57.10.mov

@ghost ghost reopened this Feb 16, 2024
@ghost ghost assigned framitdavid and unassigned ghost Feb 16, 2024
@framitdavid framitdavid removed their assignment Feb 20, 2024
@framitdavid
Copy link
Collaborator

framitdavid commented Feb 20, 2024

@WilliamThorenfeldt, your findings have been addressed in the following pull request: PR #12348. Additionally, I've identified some additional issues that need attention, and I've created a separate issue for that: Issue #12349.

@framitdavid
Copy link
Collaborator

framitdavid commented Feb 22, 2024

@WilliamThorenfeldt, I have retested your observations in dev. I can confirm that I am able to add and remove roles successfully. Additionally, the removed roles are now displayed in the selection list using their titles instead of their IDs.

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added-to-sprint area/authorization Area: Issues related to roles and rights on apps, such as who can instantiate, sign etc. kind/bug Used when there is a defect / something is not working as it should.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants