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

[timepoint_list] Candidate Info button appears with proper permissions #9696

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

adamdaudrich
Copy link
Collaborator

Brief summary of changes

  • a new smarty variable "isCandidatePerson" was added in order to isolate the display of the Candidate Info Button. The .tpl file was adjusted accordingly

  • Have you updated related documentation? Not yet

Testing instructions

User permissions settings:

  • Access Profile: View/Create Candidates and Timepoints - Own Sites
  • Candidate Parameters: View Candidate Information
  • Candidate Parameters: Edit Candidate Information
  • go to : https://<your_instance.loris.ca/CandID and click a timepoint.
  • Asssert that there is no Candidate Info Button

  • Access Profile: View/Create Candidates and Timepoints - Own Sites
  • Candidate Parameters: View Candidate Information
  • [ ] Candidate Parameters: Edit Candidate Information
  • Save and Refresh the window with your user's account, and assert that the Candidate Info button appears.

Link(s) to related issue(s)[](

#9585 (comment))

  • Resolves 9585 (Reference the issue this fixes, if any.)

Comment on lines 67 to 68
$this->tpl_data['isDataEntryPerson'] = $user->hasCenterPermission("data_entry", $cand_CenterID);

Copy link
Collaborator

Choose a reason for hiding this comment

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

@adamdaudrich why change that line if you havent changed its functionality at all ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not changed, I was playing with these class variables to learn their behaviour and re-typed it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In PRs going to the core we try to avoid unecessary changes like this because it distracts from the actual changes and may cause static errors (which this is most likely doing because of the line length rule). if its not causing an error its fine for now, if it is, undo it so the error is resolved.

{/if}
{if $isImagingPerson}
<a class="btn btn-default" role="button" href="{$baseurl}/imaging_browser/?DCCID={$candID}">View Imaging datasets</a>
{/if}
{if $isCandidatePerson}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Although this makes logical sense, its not backwards compatible.

Personally I would opt for this but the team might have a different view

@driusan @racostas @CamilleBeau @SantiagoTG any opinion on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pro this change. It makes sense to me that the button would only show if users have a permission to view candidate info

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would call the variable hasCandidateParameterAccess because I find "isCandidatePerson" a little confusing but I see why its named that for symmetry with the others..

Copy link
Collaborator

Choose a reason for hiding this comment

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

Other than that, I don't see why anyone would be opposed to this change. What backwards compatibility is lost? A button that goes to a permission denied page?

@adamdaudrich adamdaudrich changed the title [timepoint_list] Candidate Info button appeas with proper permissions [timepoint_list] Candidate Info button appears with proper permissions Mar 12, 2025
@CamilleBeau CamilleBeau removed their assignment Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants