Welcome ,
  1. Home
  2. How to Use Access Level Widgets to Control Content Visibility in PageCarton

PageCarton Documentation



Interested in coding widgets, classes, or methods? Check out the Code section!

How to Use Access Level Widgets to Control Content Visibility in PageCarton


Image

This article explains how to use PageCarton's Access Level Widgets to control content visibility based on user roles, such as content owners, invited users, or administrators. It helps ensure that only authorized users can manage or modify content, thereby improving both usability and security across your website.

Understanding Access Levels

Access levels determine who can see what is on your website. It's important to define which user should be allowed to view the content. Numerical values called AUTH LEVELS are being used to represent different types of users.

Here are the standard access levels commonly used:

Example Use Case:

  • If you only want owners and super users to be able to edit or delete a post, use

object_access_level: [98, 99]

  • If you want all signed-in users to see a button (e.g., 'Comment'), use

object_access_level: [1]\

PageCarton Access Level Widget

This ensures proper visibility control, and also enhances the security of your site by making sure that only users with the appropriate permissions such as the content Owner (98) or Super User (99) can view and interact with these sensitive actions.

Without access control, unauthorized users might see or attempt to perform actions they shouldn't have access to, which can lead to errors or vulnerabilities. Wrapping your content in an access-level condition provides a clean, secure, and professional experience for all users.

  • <widget> If it is not to be used inside another widget.
  • <widget-inner> If it is to be used inside another widget.
  • object_access_level: Limits visibility to users listed.

Example: To Hide an Edit Button from Users and make it visible for website Owner and Admin only.

This ensures that only users with the appropriate roles such as the Owner (98) or Admin (99) can see and interact with the button.

Why This Matters:

By defining and using access levels:

  • You keep sensitive actions secure.
  • You improve the user experience by showing only relevant actions to each user.
  • You avoid cluttering the interface for general visitors.

 

 

← Previous "Explaining the concepts of PageCarton""PageCarton System Requirements" Next →


 

Similar article

 

How to Add Edit and Delete Buttons with URLs in PageCarton Photo

How to Add Edit and Delete Buttons with URLs in PageCarton

This article explains how to add functional Edit and Delete buttons to content items in PageCarton, using direct URL links to PageCarton edit and delete page. These buttons allow owners and admin...

article
 

 

A Step By Step Guide To Back up and Downloading your Website on PageCarton. Photo

A Step By Step Guide To Back up and Downloading your Website on PageCarton.

In the digital age, website is the face of a business or personal brand. Whether it's a blog, an e-commerce site, or a personal website. Backing up your website files is the first step towards secu...

article
 

 

Changing Number of Posts to Display on a Widget Photo

Changing Number of Posts to Display on a Widget

Another interesting customization feature just came in the latest PageCarton. Users of PageCarton can now change the number of post shown in embedded widget from the admin panel. For example, be...

Documentation Article
 

 

Installing PageCarton via Composer Photo

Installing PageCarton via Composer

If you have Composer installed on your computer, you can easily get PageCarton up by running the following commands on your command line.  # 1. Download PageCarton via composer compose...

article
 

 

Setting up PageCarton via Docker Photo

Setting up PageCarton via Docker

PageCarton now has a few files in its GitHub repository that helps to set it up on Docker easily. If you are familiar with Docker or a newbie, you should be able to get started with PageCarton...

article