=== CodeBold Members ===
Contributors: codeboldit
Tags: roles, capabilities, user roles, content restriction, permissions
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Edit what every role on your site is allowed to do, give people more than one role, and
keep pages for the roles you choose.

== Description ==

WordPress can list your roles but not change them. Deciding that your shop assistants may
edit products but not see cost prices has meant writing code — or installing a role you
cannot adjust afterwards.

This is the role editor that should have been there.

* Edit any role. Every capability your site actually has, shown as a checkbox, grouped
  and searchable rather than as one flat list of two hundred
* Create roles, or duplicate one that is nearly right and adjust it
* Give somebody more than one role. WordPress has always supported it; its own screen
  offers a single dropdown
* Keep a page, post or product for the roles you choose
* Hide part of a page with the `[codebold_restrict]` shortcode
* Put the whole site behind a login

Capabilities invented by your theme, your other plugins or your custom post types appear
too. A role editor that only knows about core capabilities quietly under-reports what a
role can do.

= It will not lock you out =

A role editor is the one screen in a plugin like this that can end a site, and the way
back is a database client most people do not have. So it refuses:

* The administrator role can never lose the capabilities that let a human log in
* You cannot delete the role you are using
* You cannot delete a role people still hold — they would be left able to do nothing
* You cannot delete the role new sign-ups are given
* You cannot take "manage_options" from your own role unless another of your roles
  still grants it

Each refusal explains what to do instead.

= Works with CodeBold Commerce =

If the CodeBold Commerce point-of-sale plugin is installed, its permissions appear here
under their proper names — "Accept returns without a receipt" rather than
"Codebold blind return" — grouped into Till, Inventory and General. Neither plugin needs
the other.

= Nothing left behind =

No database tables and no scheduled jobs. Deleting the plugin removes its two settings
and its restrictions. **It does not delete your roles** — those are yours, people hold
them, and removing them would take away access from everybody at once.

== Installation ==

1. Install and activate.
2. Go to Roles in the admin menu.
3. Click a role to see and change what it can do.

== Frequently Asked Questions ==

= Will this break my site? =

It refuses the changes that could. See "It will not lock you out" above. If you do
manage to make a role useless, you can always edit it back — the plugin never removes
your own way in.

= Does it need WooCommerce? =

No. Roles are a WordPress idea. If WooCommerce is installed, its capabilities appear in
a Shop group; if not, that group does not appear at all.

= What happens to my roles if I delete the plugin? =

They stay exactly as you left them. Roles belong to WordPress, not to this plugin.
Anything you changed here is a permanent change to your site's roles, which is why the
editor is careful about it.

= Can I restrict a product? =

Yes — any public post type, including products and pages. Restricting a media file is
deliberately not offered, because the file stays reachable by its own URL and offering it
would imply a protection that is not there.

= What is the difference between a role and a capability? =

A role is a job title, like Editor. A capability is one thing that job is allowed to do,
like "Publish posts". A role is a list of capabilities.

== Screenshots ==

1. The role list, showing what each role can do and how many people hold it
2. Editing a role, with capabilities grouped and searchable
3. The administrator's own capabilities, locked so the site cannot be shut out
4. Keeping a page for chosen roles, from the editor sidebar

== Changelog ==

= 0.2.0 =
* Role editor: create, rename, duplicate and delete roles
* Capabilities grouped and searchable, including ones added by other plugins
* Guards against every change that would lock somebody out of their own site
* More than one role per user
* Content permissions per post, page and product
* `[codebold_restrict]` shortcode
* Private site option
* Reads capability names from CodeBold Commerce when it is installed

== Upgrade Notice ==

= 0.2.0 =
First release.
