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

NEW Form sudo mode #11582

Merged

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Jan 29, 2025

@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch 8 times, most recently from 6750198 to a41f2a4 Compare February 3, 2025 06:25
@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch 2 times, most recently from 426ea25 to d9b62d4 Compare February 3, 2025 06:57

// Activate sudo mode on login so the user doesn't have to reauthenticate for sudo
// actions until the sudo mode timeout expires
$service = Injector::inst()->get(SudoModeServiceInterface::class);
Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed offline that sudo mode should NOT be automatically activated when you log in

@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch 2 times, most recently from beb0526 to 40fa4ee Compare February 5, 2025 06:49
@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch 9 times, most recently from ae51b7f to 4bab0a8 Compare February 10, 2025 05:53
@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch from 4bab0a8 to eb23b5e Compare February 11, 2025 04:18
@emteknetnz emteknetnz marked this pull request as ready for review February 11, 2025 22:27
@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch 3 times, most recently from d14d40b to 2860c61 Compare February 17, 2025 01:17
@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch from 30480c3 to eae81b5 Compare February 18, 2025 02:43
@GuySartorelli
Copy link
Member

#11582 (comment) still not addressed

@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch from eae81b5 to 08f19c7 Compare February 19, 2025 01:39
@emteknetnz emteknetnz force-pushed the pulls/5/form-sudo-mode branch from 08f19c7 to 671b1e1 Compare February 19, 2025 23:33
Comment on lines +583 to +586
if ($sudoModeTransformation) {
// Modify the GridFieldViewButton on any GridFields so that it doesn't suffix the view URL with 'view'
// This allows us to gracefully reload a form in readonly mode when sudo mode is activated
if ($item instanceof GridFieldViewButton) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd normally ask for this to be combined into a single conditional statement but I think we're both tired of this review cycle, and the change is only a very minor code style change, so will leave as is.

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

LGTM, will give one last look locally.

@GuySartorelli GuySartorelli merged commit a4227a9 into silverstripe:5 Feb 20, 2025
17 checks passed
@GuySartorelli GuySartorelli deleted the pulls/5/form-sudo-mode branch February 20, 2025 01:23
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.

2 participants