Skip to content

[6.x] Ability to Enable Pro from the Getting Started state#15028

Open
jackmcdade wants to merge 3 commits into
6.xfrom
enable-pro-from-dashboard
Open

[6.x] Ability to Enable Pro from the Getting Started state#15028
jackmcdade wants to merge 3 commits into
6.xfrom
enable-pro-from-dashboard

Conversation

@jackmcdade

Copy link
Copy Markdown
Member

No description provided.


public function enablePro()
{
Statamic::enablePro();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gonna need authorization otherwise any one with cp access could upgrade to pro.

Suggested change
Statamic::enablePro();
if (! User::current()->isSuper()) {
throw new AuthorizationException;
}
Statamic::enablePro();

Comment thread resources/js/pages/Dashboard.vue Outdated
if (props.widgets.length === 0) useArchitecturalBackground();

function enablePro() {
router.post(props.enableProUrl);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe you want a confirmation before it happens? And probably refresh after it succeeds.

Comment thread resources/js/pages/Dashboard.vue Outdated
icon="pro-ribbon"
:heading="__('Enable Pro Mode')"
:description="__('statamic::messages.getting_started_widget_pro')"
@click="enablePro"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You probably wanna gate this so only super users can enable pro. If you add the auth on the backend it'll prevent it securely, but then this button becomes a no-op for non-super users.

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