Difference between revisions of "Extensions:Admin Only Pages"

From Lorekeeper Wiki
Jump to navigation Jump to search
(Set Up Page.)
Tag: 2017 source edit
 
m (Updating LK version and extension branch name)
Tag: 2017 source edit
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Extensioninfobox|title=the extension's name|desc=A short description|auth=Author(s)|status=status (such as WIP, testing, stable)|github={{Github|user=username|branch=branch}}|migration=yes/no|package=yes/no}}
+
{{Extensioninfobox|title=Admin Only Pages|desc=Set pages as staff-only.|auth=Preimpression|status=testing|github={{Github|user=preimpression|branch=extension/admin-only-pages}}|LKVer=2.1.0|migration=yes|package=no}}
<!-- Put a short summary of your extension here! -->
+
 
 +
This is a simple extension based on vanilla Lorekeeper. It allows staff members to set pages to be admin-only. When a non-staff user or guest 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 ==
 
== Installation ==
<!-- Describe installation. Include any requirements (such as packages), necessary commands, etc. -->
+
Pull the branch.
 +
 
 +
<pre>php artisan migrate</pre>
 +
 
 +
Done!
 +
 
 
== Configuration ==
 
== Configuration ==
<!-- Is any configuration necessary? Describe it here! -->
+
There is a very simple migration that adds a column called "admin_only". No other configuration should be necessary.
 +
 
 
== Usage ==
 
== Usage ==
<!-- Is there anything users should know about using your extension? -->
+
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.
== Troubleshooting ==
+
[[File:Admin only page error.png|alt=A red Lorekeeper error stating "You do not have the permission to access this page."|thumb|The error a non-staff user receives when attempting to access an admin-only page.]]
 +
 
 +
==Troubleshooting==
 
<!-- Are there known issues or errors that require user action? Who should they contact, and where, for support? -->
 
<!-- Are there known issues or errors that require user action? Who should they contact, and where, for support? -->
== See Also ==
+
==See Also==
 
<!-- Any relevant other pages. You may consider linking to related extensions, for instance. -->
 
<!-- Any relevant other pages. You may consider linking to related extensions, for instance. -->
 
+
<br />

Latest revision as of 13:34, 3 February 2023

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






This is a simple extension based on vanilla Lorekeeper. It allows staff members to set pages to be admin-only. When a non-staff user or guest 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.

A red Lorekeeper error stating "You do not have the permission to access this page."
The error a non-staff user receives when attempting to access an admin-only page.

Troubleshooting

See Also