YOURLS-AuthMgrPlus/README.md

95 lines
3.8 KiB
Markdown
Raw Permalink Normal View History

YOURLS-AuthMgrPlus
2013-05-29 07:55:04 +02:00
=====================
2020-08-14 08:00:14 +02:00
This plugin manages essential YOURLS functions and separates user data with role-based access controls (RBAC). With access controls enabled, you can safely delegate access to the admin pages and API while keeping link data private. You share an installation, log on, add a link, and nobody else sees it.
2013-05-29 07:58:59 +02:00
Features
--------
- Easily assign users to roles
- Easily fine tune role permissions
- IPv4 based Authentication (optional)
- All plugin pages, including main management page, hidden to non-admins by default. Easy to unblock pages.
- Plenty of hooks to filter Roles, Role Capabilities, and _any_ of the default data environemnt (such as plugin page visibility)
- Fine(r) tuned API access
- PHP 8 compatible
- No tracking of admins or editors by default
2018-09-07 23:57:43 +02:00
Requirements
------------
2019-12-07 03:31:44 +01:00
- YOURLS 1.7.3 +
2020-08-14 08:00:14 +02:00
- Incompatible Plugins:
- nicwaller's [`authmgr`](https://github.com/nicwaller/yourls-authmgr-plugin)
- Ian Barber's [`Seperate Users`](https://github.com/ianbarber/Yourls-Separate-Users)
2013-05-29 07:58:59 +02:00
Installation
------------
2020-08-14 08:00:14 +02:00
1. Download the [latest release](https://github.com/joshp23/YOURLS-AuthMgrPlus) of this plugin.
1. Copy the `authMgrPlus` folder into your `user/plugins` folder for YOURLS.
1. Set up some parameters for authMgrPlus (details below)
2013-05-29 07:58:59 +02:00
1. Activate the plugin with the plugin manager in the YOURLS admin interface.
Default Roles
-------------
The default roles are set up as follows:
Role | Capabilities
--------------|---------------------------------------------------------------------------------------------------
Administrator | Can manage plugins, no limits, not tracked on any
Editor | Can add (+API), access own and all others', edit & delete own & anon URL's, not tracked on any
Contributor | Can add (+API), access own and anon's, and edit & delete own URLs, not tracked on own
Anonymous | Can add and access (see stats, etc) anon links (If public)
2013-05-29 07:58:59 +02:00
Configuration
-------------
Add role assignments to your `user/config.php` file.
```
2019-11-14 17:53:20 +01:00
$amp_role_assignment = array(
2013-05-29 07:58:59 +02:00
'administrator' => array(
'your_username',
),
'editor' => array(
'your_close_friend',
),
'contributor' => array(
'your_other_friend',
),
);
```
You can also designate a range of IP addresses that will automatically be granted all capabilities. By default, all accesses from IPv4 localhost (127.0.0.0/8) are granted full access.
```
2019-11-14 17:53:20 +01:00
$amp_admin_ipranges = array(
2013-05-29 07:58:59 +02:00
'127.0.0.0/8',
);
```
2018-09-07 07:04:48 +02:00
Plugin management and plugin pages are available to admins only by default. Individual pages can be exposed to non-admin roles like so:
```
2019-11-14 17:53:20 +01:00
$amp_allowed_plugin_pages = array(
2018-09-07 07:04:48 +02:00
'sample_page',
'another_plugin_slug'
);
```
Explore the code to see how to set `$amp_role_capabilities` and `$amp_anon_capabilities`. These are set to defaults in the `amp_env_check()` function.
You can also assign a default role to all logged-in users that have no explicit role (note, case sensative):
2020-06-23 11:23:10 +02:00
```
$amp_default_role = "Editor";
```
#### NOTE:
2020-08-14 08:00:14 +02:00
This is a fork of nicwaller's [Authmgr](https://github.com/nicwaller/yourls-authmgr-plugin) merged with Ian barber's [Separate Users](https://github.com/joshp23/Yourls-Separate-Users) plugin. Both code bases underwent heavy rewrites, and have been extensively updated and tightly integrated here, resulting in a lean and highly functional user authorization management environment.
2013-06-18 06:17:43 +02:00
2018-10-05 17:58:38 +02:00
### Support Dev
All of my published code is developed and maintained in spare time, if you would like to support development of this, or any of my published code, I have set up a Liberpay account for just this purpose. Thank you.
<noscript><a href="https://liberapay.com/joshu42/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
2013-06-18 06:17:43 +02:00
License
-------
2018-09-08 03:16:44 +02:00
Copyright 2018 Joshua Panter
Copyright 2013 Nicholas Waller (code@nicwaller.com)
Copyright 2011 Ian Barber