-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
83 lines (55 loc) · 2.42 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
=== Plugin Name ===
Contributors: Kevin Florenz Daus
Donate link: https://www.linkedin.com/in/kevinflorenzdaus/
Tags: rbac
Requires at least: 3.0.1
Tested up to: 3.4
Stable tag: 4.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
== Description ==
With this plugin you can restrict access to certain content
that only the users with certain role can access and view
== Key Features ==
Anyone with edit/create content access can restrict content
Can be used in any custom post type.
== Usage ==
`[gm-rbac role="selected_role"]`` shortcode allows for private content to be viewed by those who have the selected role.
`[gm-rbac errorMessage="Please login here . <a href='/wp-admin'>Login here</a>"]` On the fly cuztomizable error message.
[gm-rbac role="selected_role" capability="selected_capability" ] You can use role and capability combination to better filter the user that can access the content
== Filter ==
```gm_error_message_filter```
* Allow user to edit the enclosed content. You may want to add your custom filter to wrap the content with a custom class or id.
```
Example
add_filter("gm_error_message_filter" , function($errorMessage){
$errorMessage = "<div class='my-custom-error-style-class'>".$errorMessage."</div>";
return $errorMessage;//dont forget to return it
});
```
== Action ==
```gm_before_check_action```
* Allow user to attach an event handler before checking the current users' permission on the item enclosed by the shortcode.
```gm_before_render_action```
* Allow user to attach an event handler before rendering the content enclosed in the shortcode.
```gm_after_check_action```
* Allow user to attach an event handler after checking the current users' permission on the item enclosed by the shortcode.
== Shortcode order of execution ==
1. gm_before_check_action
1. gm_after_check_action
1. gm_before_render_action
== Installation ==
This section describes how to install the plugin and get it working.
e.g.
1. Go to `https://github.com/kevindaus/gemarj-rbac/releases`
1. Download the latest release.
1. Upload the downloaded zip file by navigating to `/wp-admin/plugins.php`. Click `Add new` then click `Upload`
1. Wait until the plugin is uploaded then activate the plugin.
1. Done
== Changelog ==
= 1.0 Initial release . =
* ADD - simple role editor
* ADD - simple role manager
* ADD - settings page to customize error message
* ADD - basic help page
* ADD - shortcode gemarj-rbac