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

Locking Blocks to Prevent User Changes - Lesson #846

Closed
5 of 32 tasks
Tracked by #1041
wparasae opened this issue Jul 22, 2022 · 17 comments
Closed
5 of 32 tasks
Tracked by #1041

Locking Blocks to Prevent User Changes - Lesson #846

wparasae opened this issue Jul 22, 2022 · 17 comments
Assignees

Comments

@wparasae
Copy link
Collaborator

wparasae commented Jul 22, 2022

IMPORTANT

This lesson plan belongs to part of a greater course, Extend a Low Code Block Theme which depends on the completion of Create a Custom Block Theme #1

Please reach out to @jonathanbossenger (Jonathan Bossenger) in the #training team Slack if you would like to help with this lesson plan.

Topic Description

This teaches people how to lock blocks in a block theme, and prevent other users from unlocking locked blocks

Objectives

After completing this lesson, participants will be able to:

  • Lock specific blocks in place
  • Disable the ability to unlock blocks on a per-user basis

Guidelines

Review the [team guidelines] (https://make.wordpress.org/training/handbook/guidelines/)

Development Checklist:

  • Review any related material on Learn
  • Description and Objectives finalized
  • Gather links to Support, other learn.wordpress.org existing resources, and Developer Docs
  • Create an outline of the example lesson walk-through
  • Draft lesson plan
  • Copy edit
  • Style guide review
  • Instructional Review
  • Final review
  • Publish
  • Announce to the Training team
  • Announce to lesson plan creator
  • Announce to marketing
  • Gather feedback from lesson plan users about the quality

Repo Structure and Lesson Plan Template

Please remove all blockquote comments such as this before publishing.

Description

A short paragraph explaining what is covered in the lesson plan. This should be text that can be copied and used in a meetup or workshop description.

Target Audience

Who is this lesson intended for? What interests/skills would they bring? Put an "x" in the brackets for all that apply.

  • Users / Content Writers
  • Designers
  • Beginner-Level Developers
  • Developers
  • Speakers
  • Organizers
  • Kids

Experience Level

How much experience would a participant need to get the most from this lesson? Put an "x" in the brackets for all that apply.

  • Beginner
  • Intermediate
  • Advanced

Type of Instruction

Which strategies will be used for this lesson plan? Put an "x" in the brackets for all that apply.

  • Text-and-Image-Based, Remote-First Course
  • Exercises
  • Slides
  • Video Tutorial

Time Estimate (Duration)

How long will it take to present this lesson? Put an "x" in the brackets for the one that applies.

  • 1-5 Minutes
  • 5-10 Minutes
  • 15+ Minutes
  • 1 hour or less

Prerequisite Skills

Participants will get the most from this lesson if they have familiarity with:
These are important to include in case someone wants to use this lesson plan in-person as a stand-alone lesson.

  • Skill 1
  • Skill 2

For example:

  • Experience with HTML and CSS
  • Completed the Basic WordPress Concepts lesson

Readiness Questions

These are important to include in case someone wants to use this lesson plan in-person as a stand-alone lesson.

  • Question 1
  • Question 2

A list of questions for participants to see if they have the background and skills necessary to learn and understand the lesson.

For example:

  • Do you want to makes changes to your theme yourself?
  • Do you know how to write CSS?

Slides

If someone wanted to run this lesson as a stand-alone Online Live Workshop or at an in-person WordCamp, you could create slides for this here; if you run a Live Online Workshop on one of these topics or find someone else has, related slides would be welcome!

Change the /repo-name/ in the link to match the URL name of this repo.

  • Slides (files included in this repo)

Materials Needed

  • Item 1
  • Item 2

A list of files, resources, equipment, or other materials the presenter will need for the lesson.

For example:

  • A local install of WordPress
  • The files for the TwentySixteen theme

Notes for the Presenter

/Include any tips needed to present this topic for a Live Online Workshop or in an in-person classroom setting.

  • Note 1
  • Note 2

A list of any handy tips or other information for the presenter.

For example:

  • Participants may need to download the TwentySixteen theme before beginning
  • What to do if there’s no projector or internet available
  • What to do if a participant doesn’t have the necessary set up
  • How to handle different opinions about the topic

Lesson Outline

  • First do this
  • Then move on to this
  • Finish with this

The plan for the lesson. Outline form works well.

For example:

  • Talk about what a theme is
  • Demonstrate how to install and activate a theme
  • Practice exercises to have participants find and install a theme on their own site

Exercises

What someone will DO with what they learn in each lesson; most lessons have at least one related exercise.

Exercise name

Short description of what the exercise does and what skills or knowledge it reinforces.

  • Short point or step of the exercise
  • And another one

These are short or specific activities that help participants practice certain components of the lesson. They should not be fully scripted exercises, but rather something that participants could do on their own. For example, you can create an exercise based on one step of the Example Lesson.

Assessment

These assessments will be autograded on Learn.WordPress.org.
There should be one assessment item (or more) for each objective listed above. Each assessment item should support an objective; there should be none that don't.

Write out the question.

  1. Option
  2. Option
  3. Option
  4. Option

Answer: 3. Correct answer

A few questions to ask participants to evaluate their retention of the material presented. They should be a measure of whether the objectives were reached. Consider having a question for each objective.

Additional Resources

  • Resource 1
  • Resource 2

An optional section which can contain a list of resources that the presenter can use to get more information on the topic.

For example:

  • Link to information on the Codex
  • Theme Review Team's Handbook

Example Lesson [Written for a text-and-image based, multimedia course rather than for a live classroom setting]

An example of how the lesson plan can be implemented. Written in script form as one possible way an presenter might use this lesson plan at an event, with screenshots and instructions if necessary.

Section Heading for Example Lesson

You will likely need to break the Example Lesson down into multiple sections.

Lesson Wrap Up

Follow with the Exercises and Assessment outlined above.

@wparasae wparasae added [Content Type] Lesson Plan Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. labels Jul 22, 2022
@jonathanbossenger
Copy link
Collaborator

@wparasae after doing the research and prep for the block locking for beginners workshop, I discovered the following:

  1. The purpose of block locking is to make it so that anyone editing the theme on another WordPress install (ie client site) can't move or remove the locked blocks when editing the theme in the Site Editor.
  2. In order to edit the theme in the site editor, you need to be an administrator user, or a custom user role, which has the install_themes capability (or similar).
  3. This same user type will be able to unlock the blocks in the UI (this is just how it works currently) so the way to prevent this is to use some custom PHP code in your functions.php (details here on using canLockBlocks).
  4. If we think about it, this makes sense, because if we made it a setting in the UI somewhere, someone could just disable the setting. So requiring it to be set at the code level means only someone with access to the code, and knowing what they are doing, would be able to disable it.

Given all this, I'm wondering if it makes sense to keep this in your low-code course, or move it to the Extend a Block Theme course?

@wparasae
Copy link
Collaborator Author

Given all this, I'm wondering if it makes sense to keep this in your low-code course, or move it to the Extend a Block Theme course?

Yes, we should definitely move this. Thank you for diving so deeply into this! You're welcome to link to this in your course, and I will remove it from mine when I do my course overhaul. :)

@jonathanbossenger
Copy link
Collaborator

Thank you for diving so deeply into this!

My pleasure!

You're welcome to link to this in your course, and I will remove it from mine when I do my course overhaul. :)

Awesome, I've linked this issue up to my course overview issue, so feel free to assign it to me when you overhaul your course.

@jonathanbossenger jonathanbossenger changed the title [Related Course: Create a Custom Block Theme #1] Lock Blocking Basics in theme.json - Lesson Plan Locking Blocks to Prevent User Changes - Lesson Plan Sep 16, 2022
@jonathanbossenger
Copy link
Collaborator

@courtneyr-dev
Copy link
Collaborator

This is a duplicate of #739 in its purpose. Can we close this one @wparasae ?

@jonathanbossenger jonathanbossenger changed the title Locking Blocks to Prevent User Changes - Lesson Plan Locking Blocks to Prevent User Changes - Lesson Sep 21, 2022
@jonathanbossenger jonathanbossenger removed Priority - High High priority issue. [Content Type] Lesson Plan Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. labels Sep 21, 2022
@jonathanbossenger
Copy link
Collaborator

@courtneyr-dev this lesson forms part of a course and is being used to track the development status of that course. So if we could please leave this open until this lesson in that course is ready to be created, thanks.

@ryanwelcher
Copy link
Collaborator

I'll be working on this :)

@jonathanbossenger
Copy link
Collaborator

@justintadlock, just confirming you're taking over this lesson as well?

@justintadlock
Copy link

justintadlock commented Oct 26, 2022

@justintadlock, just confirming you're taking over this lesson as well?

Yes, I am handling this one too.

Edit: I'm hoping to have a draft of this lesson up today here: https://github.com/justintadlock/block-theme-course/tree/main/module-09

@justintadlock
Copy link

Draft is up now: https://github.com/justintadlock/block-theme-course/blob/main/module-09/02-Locking-Blocks-to-Prevent-User-Changes.md

Still needs copyediting.

@jonathanbossenger
Copy link
Collaborator

@justintadlock had a quick read-through, and everything looks great.

I have one request for this lesson, would it be possible to add a short section about using the canLockBlocks setting to disable the feature globally or conditionally?

Details here https://make.wordpress.org/core/2022/05/05/block-locking-settings-in-wordpress-6-0/

@justintadlock
Copy link

@jonathanbossenger - Just catching up with your last reply. It was my understanding based on the conversation above that we did not want to dive into filtering user permissions for this module. Maybe I'm mixing up which course this is supposed to go into. :) I did leave a note and link for further reading. I'm happy to add another section in, but I want to double-check to make sure.

It's also worth noting that the Theme Review Team does not allow this in themes in the official directory.

@jonathanbossenger
Copy link
Collaborator

@justintadlock aha, apologies, that conversation was when this module was part of Develop Your First Low-Code Block Theme course. After my research into that section, we discovered that it would make more sense in this "developer" focused guide to block themes.

It's also worth noting that the Theme Review Team does not allow this in themes in the official directory.

Hmm, that's interesting. I do understand why though because usually an admin would need to install the theme, and you don't want to be locking admins out accidentally.

I'll do a bit more digging into this, I think it's worth showing how locking blocks in themes can be effective to prevent users making changes to the theme, but to the best of my knowledge, only admins can edit themes anyway, so it ends up not making much sense to lock the blocks in a theme in the first place, unless I'm missing something.

Let's leave it for now, and I'll do a bit more research. We can always update the lesson as things change.

@justintadlock
Copy link

No problem. Just let me know if things change and you want me to fill in those bits too. Happy to do so!

@westnz
Copy link
Collaborator

westnz commented Nov 23, 2022

Review:

A very practical lesson with helpful code snippets and advice.

This is the last lesson in the course. I suggest adding a conclusion and congratulating learners for completing the course etc.

@jonathanbossenger
Copy link
Collaborator

This is the last lesson in the course. I suggest adding a conclusion and congratulating learners for completing the course etc.

👍 done - https://learn.wordpress.org/lesson/congratulations-2/. Let me know if you think anything else could be added here.

@westnz
Copy link
Collaborator

westnz commented Nov 29, 2022

Looks great!

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

No branches or pull requests

6 participants