Restricting access to activities and resources is a setting choice when you add an activity or resource:
Steps
With editing turned on, click on Add an activity or resource to add an item to your topic
In the settings for the activity/resource, click on the Restrict access tab to open the settings
Click on the Add restriction... button to open the restriction list
Select the type of restriction from the restriction list
You can add multiple restrictions to the same activity or resource, by selecting the Add restriction button again
If you have multiple restrictions you can choose whether students have to meet any or all of the restrictions you list. If students need to meet some but not all of the restrictions (e.g. different cohorts need access from different dates), use the restriction set (see step 4) to join those restrictions together.
Students can see the existence of restricted items by default (they won't be able to access them by default, but will know that they exist). To only show a restricted item to those who have access to it, click on the eye icon so that there is a line running through it. Depending on how your restrictions are set up, the eye may appear in different (and multiple) places.
If your restriction is based on private information (e.g. personal data or grades) you should always make it hidden.
Click Save and return to topic when finished. The restriction you place on an item will display an alert in the module