Difference between revisions of "Extensions:Admin Only Pages"

From Lorekeeper Wiki
Jump to navigation Jump to search
(Undo revision 431 by Preimpression (talk))
Tag: Undo
Tag: 2017 source edit
Line 6: Line 6:
 
Pull the branch.
 
Pull the branch.
  
<syntaxhighlight>php artisan migrate</syntaxhighlight>
+
<pre>php artisan migrate</pre>
  
 
Done!
 
Done!

Revision as of 20:11, 5 July 2020

Admin Only Pages
Description Set pages as admin-only.
Author(s) Preimpression
Status testing
Github admin-only_pages
LK Version Unspecified
Contains a Migration






This is a simple extension based on vanilla Lorekeeper. It allows admins to set pages to be admin-only. When a non-admin or guests attempts to visit an admin-only page, they will be redirected to the home page with the standard warning. This warning is contained in the Controller and is separate from the regular admin middleware, so if you have edited that flash elsewhere, you'll need to edit it again here.

Installation

Pull the branch.

php artisan migrate

Done!

Configuration

There is a very simple migration that adds a column called "admin_only". No other configuration should be necessary.

Usage

Pre-existing pages will automatically be set to false (0 in the database.) To set a page to be admin-only, go to the admin panel and edit the page. The toggle will be right below the Is-Visible toggle.