Advanced Access Manager - Version 5.9.5

Version Description

  • Fixed the bug with Access Policy Param value that was not evaluating embedded markers
  • Fixed the bug that was causing PHP Warning for users that have none-existing role assigned
  • Fixed the bug with Customizer that was blocking user from publishing changes
  • Added support for tags - the ability to manage access to posts by none-hierarchical terms
  • Added the ability to define dynamic Resource names with markers in Access Policies
  • Added new Access Policy marker USERMETA https://aamplugin.com/reference/policy#usermeta
Download this release

Release Info

Developer vasyltech
Plugin Icon 128x128 Advanced Access Manager
Version 5.9.5
Comparing to
See all releases

Code changes from version 5.9.4 to 5.9.5

Application/Backend/Feature/Main/Post.php CHANGED
@@ -158,9 +158,8 @@ class AAM_Backend_Feature_Main_Post extends AAM_Backend_Feature_Abstract {
158
  }
159
 
160
  if (empty($parent)) {
161
- $taxonomies = array_filter(
162
- get_object_taxonomies($record), 'is_taxonomy_hierarchical'
163
- );
164
  if (!empty($taxonomies)) {
165
  $terms = wp_get_object_terms(
166
  $record->ID, $taxonomies, array('fields' => 'names')
@@ -182,10 +181,10 @@ class AAM_Backend_Feature_Main_Post extends AAM_Backend_Feature_Abstract {
182
  $response['data'][] = array(
183
  $record->term_id . '|' . $record->taxonomy . '|' . $type,
184
  get_edit_term_link($record->term_id, $record->taxonomy),
185
- 'term',
186
  $record->name,
187
  implode(',', apply_filters('aam-term-row-actions', array('manage', 'edit'), $subject, $record, $type)),
188
- rtrim($this->getParentTermList($record), '/'),
189
  apply_filters(
190
  'aam-term-override-status',
191
  false,
@@ -245,8 +244,11 @@ class AAM_Backend_Feature_Main_Post extends AAM_Backend_Feature_Abstract {
245
  }
246
 
247
  /**
 
 
 
248
  *
249
- * @return type
250
  */
251
  protected function prepareContentList($type) {
252
  $list = array();
@@ -258,10 +260,10 @@ class AAM_Backend_Feature_Main_Post extends AAM_Backend_Feature_Abstract {
258
  //calculate how many term and/or posts we need to fetch
259
  $paging = $this->getFetchPagination($type, $s, $start, $length);
260
 
261
- //first retrieve all hierarchical terms that belong to Post Type
262
  if ($paging['terms']) {
263
  $list = $this->retrieveTermList(
264
- $this->getTypeTaxonomies($type),
265
  $s,
266
  $paging['term_offset'],
267
  $paging['terms']
@@ -285,24 +287,6 @@ class AAM_Backend_Feature_Main_Post extends AAM_Backend_Feature_Abstract {
285
  );
286
  }
287
 
288
- /**
289
- *
290
- * @param type $type
291
- * @return type
292
- */
293
- protected function getTypeTaxonomies($type) {
294
- $list = array();
295
-
296
- foreach (get_object_taxonomies($type) as $name) {
297
- if (is_taxonomy_hierarchical($name)) {
298
- //get all terms that have no parent category
299
- $list[] = $name;
300
- }
301
- }
302
-
303
- return $list;
304
- }
305
-
306
  /**
307
  *
308
  * @param type $type
@@ -315,7 +299,7 @@ class AAM_Backend_Feature_Main_Post extends AAM_Backend_Feature_Abstract {
315
  $result = array('terms' => 0, 'posts' => 0, 'term_offset' => $offset);
316
 
317
  //get terms count
318
- $taxonomy = $this->getTypeTaxonomies($type);
319
 
320
  if (!empty($taxonomy)) {
321
  $terms = get_terms(array(
@@ -396,11 +380,12 @@ class AAM_Backend_Feature_Main_Post extends AAM_Backend_Feature_Abstract {
396
 
397
  /**
398
  *
399
- * @param type $type
400
- * @param type $search
401
- * @param type $offset
402
- * @param type $limit
403
- * @return type
 
404
  */
405
  protected function retrievePostList($type, $search, $offset, $limit) {
406
  return get_posts(array(
158
  }
159
 
160
  if (empty($parent)) {
161
+ $taxonomies = get_object_taxonomies($record);
162
+
 
163
  if (!empty($taxonomies)) {
164
  $terms = wp_get_object_terms(
165
  $record->ID, $taxonomies, array('fields' => 'names')
181
  $response['data'][] = array(
182
  $record->term_id . '|' . $record->taxonomy . '|' . $type,
183
  get_edit_term_link($record->term_id, $record->taxonomy),
184
+ (is_taxonomy_hierarchical($record->taxonomy) ? 'cat' : 'tag'),
185
  $record->name,
186
  implode(',', apply_filters('aam-term-row-actions', array('manage', 'edit'), $subject, $record, $type)),
187
+ is_taxonomy_hierarchical($record->taxonomy) ? rtrim($this->getParentTermList($record), '/') : '',
188
  apply_filters(
189
  'aam-term-override-status',
190
  false,
244
  }
245
 
246
  /**
247
+ * Undocumented function
248
+ *
249
+ * @param string $type
250
  *
251
+ * @return void
252
  */
253
  protected function prepareContentList($type) {
254
  $list = array();
260
  //calculate how many term and/or posts we need to fetch
261
  $paging = $this->getFetchPagination($type, $s, $start, $length);
262
 
263
+ //first retrieve all terms that belong to Post Type
264
  if ($paging['terms']) {
265
  $list = $this->retrieveTermList(
266
+ get_object_taxonomies($type),
267
  $s,
268
  $paging['term_offset'],
269
  $paging['terms']
287
  );
288
  }
289
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  /**
291
  *
292
  * @param type $type
299
  $result = array('terms' => 0, 'posts' => 0, 'term_offset' => $offset);
300
 
301
  //get terms count
302
+ $taxonomy = get_object_taxonomies($type);
303
 
304
  if (!empty($taxonomy)) {
305
  $terms = get_terms(array(
380
 
381
  /**
382
  *
383
+ * @param string $type
384
+ * @param string $search
385
+ * @param int $offset
386
+ * @param int $limit
387
+ *
388
+ * @return array
389
  */
390
  protected function retrievePostList($type, $search, $offset, $limit) {
391
  return get_posts(array(
Application/Backend/Manager.php CHANGED
@@ -664,7 +664,7 @@ class AAM_Backend_Manager {
664
  * @param type $term
665
  */
666
  public function renderTermMetabox($term) {
667
- if (is_a($term, 'WP_Term') && is_taxonomy_hierarchical($term->taxonomy)) {
668
  $frontend = AAM_Core_Config::get('core.settings.frontendAccessControl', true);
669
  $backend = AAM_Core_Config::get('core.settings.backendAccessControl', true);
670
  $api = AAM_Core_Config::get('core.settings.apiAccessControl', true);
@@ -798,7 +798,7 @@ class AAM_Backend_Manager {
798
  public function printJavascript() {
799
  if (AAM::isAAM()) {
800
  wp_enqueue_script('aam-vendor', AAM_MEDIA . '/js/vendor.js');
801
- wp_enqueue_script('aam-main', AAM_MEDIA . '/js/aam-5.9.4.js');
802
 
803
  //add plugin localization
804
  $this->printLocalization('aam-main');
664
  * @param type $term
665
  */
666
  public function renderTermMetabox($term) {
667
+ if (is_a($term, 'WP_Term')) {
668
  $frontend = AAM_Core_Config::get('core.settings.frontendAccessControl', true);
669
  $backend = AAM_Core_Config::get('core.settings.backendAccessControl', true);
670
  $api = AAM_Core_Config::get('core.settings.apiAccessControl', true);
798
  public function printJavascript() {
799
  if (AAM::isAAM()) {
800
  wp_enqueue_script('aam-vendor', AAM_MEDIA . '/js/vendor.js');
801
+ wp_enqueue_script('aam-main', AAM_MEDIA . '/js/aam-5.9.5.js');
802
 
803
  //add plugin localization
804
  $this->printLocalization('aam-main');
Application/Core/Policy/Manager.php CHANGED
@@ -195,7 +195,11 @@ final class AAM_Core_Policy_Manager {
195
  $param = $this->tree['Param'][$id];
196
 
197
  if ($this->isApplicable($param, $args)) {
198
- $value = $param['Value'];
 
 
 
 
199
  }
200
  }
201
 
@@ -332,6 +336,11 @@ final class AAM_Core_Policy_Manager {
332
  $acts = (isset($stm['Action']) ? (array) $stm['Action'] : array(''));
333
 
334
  foreach($list as $res) {
 
 
 
 
 
335
  foreach($acts as $act) {
336
  $id = $this->strToLower($res . (!empty($act) ? ":{$act}" : ''));
337
 
195
  $param = $this->tree['Param'][$id];
196
 
197
  if ($this->isApplicable($param, $args)) {
198
+ if (preg_match_all('/(\$\{[^}]+\})/', $param['Value'], $match)) {
199
+ $value = AAM_Core_Policy_Token::evaluate($param['Value'], $match[1]);
200
+ } else {
201
+ $value = $param['Value'];
202
+ }
203
  }
204
  }
205
 
336
  $acts = (isset($stm['Action']) ? (array) $stm['Action'] : array(''));
337
 
338
  foreach($list as $res) {
339
+ // Allow to build resource name dynamically.
340
+ // e.g. "Term:category:${USERMETA.region}:posts"
341
+ if (preg_match_all('/(\$\{[^}]+\})/', $res, $match)) {
342
+ $res = AAM_Core_Policy_Token::evaluate($res, $match[1]);
343
+ }
344
  foreach($acts as $act) {
345
  $id = $this->strToLower($res . (!empty($act) ? ":{$act}" : ''));
346
 
Application/Core/Policy/Token.php CHANGED
@@ -25,13 +25,14 @@ final class AAM_Core_Policy_Token {
25
  * @static
26
  */
27
  protected static $map = array(
28
- 'USER' => 'AAM_Core_Policy_Token::getUserValue',
29
- 'DATETIME' => 'AAM_Core_Policy_Token::getDateTimeValue',
30
- 'GET' => 'AAM_Core_Request::get',
31
- 'POST' => 'AAM_Core_Request::post',
32
- 'COOKIE' => 'AAM_Core_Request::cookie',
33
- 'SERVER' => 'AAM_Core_Request::server',
34
- 'ARGS' => 'AAM_Core_Policy_Token::getArgValue'
 
35
  );
36
 
37
  /**
@@ -126,6 +127,35 @@ final class AAM_Core_Policy_Token {
126
 
127
  return $value;
128
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
  /**
131
  * Get inline argument
25
  * @static
26
  */
27
  protected static $map = array(
28
+ 'USER' => 'AAM_Core_Policy_Token::getUserValue',
29
+ 'USERMETA' => 'AAM_Core_Policy_Token::getUserMetaValue',
30
+ 'DATETIME' => 'AAM_Core_Policy_Token::getDateTimeValue',
31
+ 'GET' => 'AAM_Core_Request::get',
32
+ 'POST' => 'AAM_Core_Request::post',
33
+ 'COOKIE' => 'AAM_Core_Request::cookie',
34
+ 'SERVER' => 'AAM_Core_Request::server',
35
+ 'ARGS' => 'AAM_Core_Policy_Token::getArgValue'
36
  );
37
 
38
  /**
127
 
128
  return $value;
129
  }
130
+
131
+ /**
132
+ * Get user meta value(s)
133
+ *
134
+ * @param string $metakey
135
+ *
136
+ * @return void
137
+ *
138
+ * @access protected
139
+ * @static
140
+ */
141
+ protected static function getUserMetaValue($metakey) {
142
+ $value = null;
143
+ $id = get_current_user_id();
144
+
145
+ if (!empty($id)) { // Only authenticated users have some sort of meta
146
+ $meta = get_user_meta($id, $metakey);
147
+
148
+ // If $meta has only one value in the array, then extract it, otherwise
149
+ // return the array of values
150
+ if (count($meta) === 1) {
151
+ $value = array_shift($meta);
152
+ } else {
153
+ $value = array_values($meta);
154
+ }
155
+ }
156
+
157
+ return $value;
158
+ }
159
 
160
  /**
161
  * Get inline argument
Application/Core/Subject/User.php CHANGED
@@ -156,7 +156,9 @@ class AAM_Core_Subject_User extends AAM_Core_Subject {
156
  // prepare the list of capabilities that should still be assigned to user
157
  $keepCaps = array();
158
  foreach($roles as $role) {
159
- $keepCaps = array_merge($keepCaps, $allRoles->get_role($role)->capabilities);
 
 
160
  }
161
 
162
  foreach(array_keys($removeCaps) as $key) {
156
  // prepare the list of capabilities that should still be assigned to user
157
  $keepCaps = array();
158
  foreach($roles as $role) {
159
+ if ($allRoles->is_role($role)) {
160
+ $keepCaps = array_merge($keepCaps, $allRoles->get_role($role)->capabilities);
161
+ }
162
  }
163
 
164
  foreach(array_keys($removeCaps) as $key) {
Application/Extension/List.php CHANGED
@@ -22,7 +22,7 @@ class AAM_Extension_List {
22
  'description' => 'Get the complete list of all premium AAM extensions in one package and all future premium extensions already included for now additional cost.',
23
  'url' => 'https://aamplugin.com/complete-package',
24
  'version' => (defined('AAM_COMPLETE_PACKAGE') ? constant('AAM_COMPLETE_PACKAGE') : null),
25
- 'latest' => '3.8.20'
26
  ),
27
  'AAM_PLUS_PACKAGE' => array(
28
  'title' => 'Plus Package',
@@ -31,7 +31,7 @@ class AAM_Extension_List {
31
  'description' => 'Manage access to your WordPress website posts, pages, media, custom post types, categories and hierarchical taxonomies for any role, individual user, visitors or even define default access for everybody; and do this separately for frontend, backend or API levels. As the bonus, define more granular access to how comments can be managed on the backend by other users.',
32
  'url' => 'https://aamplugin.com/extension/plus-package',
33
  'version' => (defined('AAM_PLUS_PACKAGE') ? constant('AAM_PLUS_PACKAGE') : null),
34
- 'latest' => '3.9.7'
35
  ),
36
  'AAM_IP_CHECK' => array(
37
  'title' => 'IP Check',
22
  'description' => 'Get the complete list of all premium AAM extensions in one package and all future premium extensions already included for now additional cost.',
23
  'url' => 'https://aamplugin.com/complete-package',
24
  'version' => (defined('AAM_COMPLETE_PACKAGE') ? constant('AAM_COMPLETE_PACKAGE') : null),
25
+ 'latest' => '3.8.21'
26
  ),
27
  'AAM_PLUS_PACKAGE' => array(
28
  'title' => 'Plus Package',
31
  'description' => 'Manage access to your WordPress website posts, pages, media, custom post types, categories and hierarchical taxonomies for any role, individual user, visitors or even define default access for everybody; and do this separately for frontend, backend or API levels. As the bonus, define more granular access to how comments can be managed on the backend by other users.',
32
  'url' => 'https://aamplugin.com/extension/plus-package',
33
  'version' => (defined('AAM_PLUS_PACKAGE') ? constant('AAM_PLUS_PACKAGE') : null),
34
+ 'latest' => '3.10'
35
  ),
36
  'AAM_IP_CHECK' => array(
37
  'title' => 'IP Check',
Application/Shared/Manager.php CHANGED
@@ -333,7 +333,7 @@ class AAM_Shared_Manager {
333
  *
334
  * @param WP_Query $wpQuery
335
  *
336
- * @return string
337
  *
338
  * @access protected
339
  */
@@ -471,13 +471,9 @@ class AAM_Shared_Manager {
471
  // First of all delete all artificial capability from the $caps
472
  foreach($caps as $i => $capability) {
473
  if (strpos($capability, 'aam|') === 0) {
474
- $parts = explode('|', $capability);
475
-
476
- if (in_array($parts[1], array('edit_post', 'delete_post', 'read_post'), true)) {
477
- $capability = null; //remove primitive from the meta array
478
- } else {
479
- $capability = $parts[2];
480
- }
481
  }
482
 
483
  if (in_array($capability, AAM_Backend_Feature_Main_Capability::$groups['aam'], true)) {
333
  *
334
  * @param WP_Query $wpQuery
335
  *
336
+ * @return array
337
  *
338
  * @access protected
339
  */
471
  // First of all delete all artificial capability from the $caps
472
  foreach($caps as $i => $capability) {
473
  if (strpos($capability, 'aam|') === 0) {
474
+ // Remove this capability from the mapped array and let WP Core
475
+ // handle the correct mapping
476
+ $capability = null;
 
 
 
 
477
  }
478
 
479
  if (in_array($capability, AAM_Backend_Feature_Main_Capability::$groups['aam'], true)) {
aam.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Plugin Name: Advanced Access Manager
5
  * Description: All you need to manage access to your WordPress website
6
- * Version: 5.9.4
7
  * Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  * Author URI: https://vasyltech.com
9
  *
@@ -69,8 +69,12 @@ class AAM {
69
  }
70
 
71
  /**
 
72
  *
73
- * @return type
 
 
 
74
  */
75
  public static function api() {
76
  return AAM_Core_Gateway::getInstance();
@@ -269,7 +273,8 @@ if (defined('ABSPATH')) {
269
  require (dirname(__FILE__) . '/autoloader.php');
270
  AAM_Autoloader::register();
271
 
272
- add_action('plugins_loaded', 'AAM::onPluginsLoaded', 1);
 
273
 
274
  //the highest priority (higher the core)
275
  //this is important to have to catch events like register core post types
3
  /**
4
  * Plugin Name: Advanced Access Manager
5
  * Description: All you need to manage access to your WordPress website
6
+ * Version: 5.9.5
7
  * Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  * Author URI: https://vasyltech.com
9
  *
69
  }
70
 
71
  /**
72
+ * Get AAM API manager
73
  *
74
+ * @return AAM_Core_Gateway
75
+ *
76
+ * @access public
77
+ * @static
78
  */
79
  public static function api() {
80
  return AAM_Core_Gateway::getInstance();
273
  require (dirname(__FILE__) . '/autoloader.php');
274
  AAM_Autoloader::register();
275
 
276
+ // Keep this as the lowest priority
277
+ add_action('plugins_loaded', 'AAM::onPluginsLoaded', -1);
278
 
279
  //the highest priority (higher the core)
280
  //this is important to have to catch events like register core post types
media/css/aam.css CHANGED
@@ -107,6 +107,7 @@
107
  .icon-cancel-circled:before { content: '\e81d' !important; } /* '' */
108
  .icon-info-circled:before { content: '\e81f' !important; } /* '' */
109
  .icon-attention:before { content: '\e81e' !important; } /* '' */
 
110
 
111
  .icon-image-40 {
112
  font-size: 40px;
107
  .icon-cancel-circled:before { content: '\e81d' !important; } /* '' */
108
  .icon-info-circled:before { content: '\e81f' !important; } /* '' */
109
  .icon-attention:before { content: '\e81e' !important; } /* '' */
110
+ .icon-tag:before { content: '\e821' !important; } /* 'î ¡' */
111
 
112
  .icon-image-40 {
113
  font-size: 40px;
media/font/fontello.eot CHANGED
Binary file
media/font/fontello.svg CHANGED
@@ -72,6 +72,8 @@
72
 
73
  <glyph glyph-name="user-plus" unicode="&#xe820;" d="M393 350q-89 0-152 63t-62 151 62 152 152 63 151-63 63-152-63-151-151-63z m536-71h196q7 0 13-6t5-12v-107q0-8-5-13t-13-5h-196v-197q0-7-6-12t-12-6h-107q-8 0-13 6t-5 12v197h-197q-7 0-12 5t-6 13v107q0 7 6 12t12 6h197v196q0 7 5 13t13 5h107q7 0 12-5t6-13v-196z m-411-125q0-29 21-51t50-21h143v-133q-38-28-95-28h-488q-67 0-108 39t-41 106q0 30 2 58t8 61 15 60 24 55 34 45 48 30 62 11q11 0 22-10 44-34 86-51t92-17 92 17 86 51q11 10 22 10 73 0 121-54h-125q-29 0-50-21t-21-50v-107z" horiz-adv-x="1142.9" />
74
 
 
 
75
  <glyph glyph-name="box" unicode="&#xe822;" d="M607 386q0 14-10 25t-26 10h-142q-15 0-26-10t-10-25 10-25 26-11h142q15 0 26 11t10 25z m322 107v-536q0-14-11-25t-25-11h-786q-14 0-25 11t-11 25v536q0 14 11 25t25 11h786q14 0 25-11t11-25z m35 250v-143q0-15-10-25t-25-11h-858q-14 0-25 11t-10 25v143q0 14 10 25t25 11h858q14 0 25-11t10-25z" horiz-adv-x="1000" />
76
 
77
  <glyph glyph-name="plus-circled" unicode="&#xe823;" d="M679 314v72q0 14-11 25t-25 10h-143v143q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-143h-143q-14 0-25-10t-10-25v-72q0-14 10-25t25-10h143v-143q0-15 11-25t25-11h71q15 0 25 11t11 25v143h143q14 0 25 10t11 25z m178 36q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
72
 
73
  <glyph glyph-name="user-plus" unicode="&#xe820;" d="M393 350q-89 0-152 63t-62 151 62 152 152 63 151-63 63-152-63-151-151-63z m536-71h196q7 0 13-6t5-12v-107q0-8-5-13t-13-5h-196v-197q0-7-6-12t-12-6h-107q-8 0-13 6t-5 12v197h-197q-7 0-12 5t-6 13v107q0 7 6 12t12 6h197v196q0 7 5 13t13 5h107q7 0 12-5t6-13v-196z m-411-125q0-29 21-51t50-21h143v-133q-38-28-95-28h-488q-67 0-108 39t-41 106q0 30 2 58t8 61 15 60 24 55 34 45 48 30 62 11q11 0 22-10 44-34 86-51t92-17 92 17 86 51q11 10 22 10 73 0 121-54h-125q-29 0-50-21t-21-50v-107z" horiz-adv-x="1142.9" />
74
 
75
+ <glyph glyph-name="tag" unicode="&#xe821;" d="M250 600q0 30-21 51t-50 20-51-20-21-51 21-50 51-21 50 21 21 50z m595-321q0-30-20-51l-274-274q-22-21-51-21-30 0-50 21l-399 399q-21 21-36 57t-15 65v232q0 29 21 50t50 22h233q29 0 65-15t57-36l399-399q20-21 20-50z" horiz-adv-x="857.1" />
76
+
77
  <glyph glyph-name="box" unicode="&#xe822;" d="M607 386q0 14-10 25t-26 10h-142q-15 0-26-10t-10-25 10-25 26-11h142q15 0 26 11t10 25z m322 107v-536q0-14-11-25t-25-11h-786q-14 0-25 11t-11 25v536q0 14 11 25t25 11h786q14 0 25-11t11-25z m35 250v-143q0-15-10-25t-25-11h-858q-14 0-25 11t-10 25v143q0 14 10 25t25 11h858q14 0 25-11t10-25z" horiz-adv-x="1000" />
78
 
79
  <glyph glyph-name="plus-circled" unicode="&#xe823;" d="M679 314v72q0 14-11 25t-25 10h-143v143q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-143h-143q-14 0-25-10t-10-25v-72q0-14 10-25t25-10h143v-143q0-15 11-25t25-11h71q15 0 25 11t11 25v143h143q14 0 25 10t11 25z m178 36q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
media/font/fontello.ttf CHANGED
Binary file
media/font/fontello.woff CHANGED
Binary file
media/font/fontello.woff2 CHANGED
Binary file
media/js/{aam-5.9.4.js → aam-5.9.5.js} RENAMED
@@ -2473,6 +2473,11 @@
2473
  * @returns {undefined}
2474
  */
2475
  getAAM().loadAccessForm = function(object, id, btn, callback) {
 
 
 
 
 
2476
  //reset the form first
2477
  var container = $('.aam-access-form[data-type="' + object + '"]');
2478
  $('#post-overwritten').addClass('hidden');
@@ -2671,14 +2676,22 @@
2671
  rowCallback: function (row, data) {
2672
  //object type icon
2673
  var icon = 'icon-doc-text-inv';
 
2674
 
2675
  switch (data[2]) {
2676
  case 'type':
2677
  icon = 'icon-box';
 
2678
  break;
2679
 
2680
- case 'term':
2681
  icon = 'icon-folder';
 
 
 
 
 
 
2682
  break;
2683
 
2684
  default:
@@ -2693,7 +2706,9 @@
2693
  }));
2694
  } else {
2695
  $('td:eq(0)', row).html($('<i/>', {
2696
- 'class': icon
 
 
2697
  }));
2698
  }
2699
 
@@ -2717,7 +2732,7 @@
2717
 
2718
  }).html(data[3]);
2719
  $('td:eq(1)', row).html(link);
2720
- } else if (data[2] === 'term') {
2721
  $('td:eq(1)', row).html($('<span/>').text(data[3]));
2722
 
2723
  var sub = $('<i class="aam-row-subtitle"></i>');
@@ -2732,6 +2747,15 @@
2732
  sub.append($('<span/>').text(getAAM().__('ID:') + ' '));
2733
  sub.append($('<strong/>').text(data[0].split('|')[0]));
2734
 
 
 
 
 
 
 
 
 
 
2735
  $('td:eq(1)', row).append(sub);
2736
  } else {
2737
  $('td:eq(1)', row).html($('<span/>').text(data[3]));
@@ -2807,10 +2831,16 @@
2807
  'class': 'aam-row-action text-muted icon-pencil'
2808
  }));
2809
  break;
 
 
 
 
 
 
2810
 
2811
  case 'pin' :
2812
  $(container).append($('<i/>', {
2813
- 'class': 'aam-row-action text-muted icon-pin'
2814
  }).bind('click', function () {
2815
  var _btn = $(this);
2816
  $.ajax(getLocal().ajaxurl, {
2473
  * @returns {undefined}
2474
  */
2475
  getAAM().loadAccessForm = function(object, id, btn, callback) {
2476
+ // TODO: Rethink this shortcut
2477
+ if (object === 'cat' || object === 'tag') {
2478
+ object = 'term';
2479
+ }
2480
+
2481
  //reset the form first
2482
  var container = $('.aam-access-form[data-type="' + object + '"]');
2483
  $('#post-overwritten').addClass('hidden');
2676
  rowCallback: function (row, data) {
2677
  //object type icon
2678
  var icon = 'icon-doc-text-inv';
2679
+ var tooltip = getAAM().__('Post');
2680
 
2681
  switch (data[2]) {
2682
  case 'type':
2683
  icon = 'icon-box';
2684
+ tooltip = getAAM().__('Post Type');
2685
  break;
2686
 
2687
+ case 'cat':
2688
  icon = 'icon-folder';
2689
+ tooltip = getAAM().__('Hierarchical Term');
2690
+ break;
2691
+
2692
+ case 'tag':
2693
+ icon = 'icon-tag';
2694
+ tooltip = getAAM().__('Tag');
2695
  break;
2696
 
2697
  default:
2706
  }));
2707
  } else {
2708
  $('td:eq(0)', row).html($('<i/>', {
2709
+ 'class': icon,
2710
+ 'data-toggle': "tooltip",
2711
+ 'title': tooltip
2712
  }));
2713
  }
2714
 
2732
 
2733
  }).html(data[3]);
2734
  $('td:eq(1)', row).html(link);
2735
+ } else if (data[2] === 'cat') {
2736
  $('td:eq(1)', row).html($('<span/>').text(data[3]));
2737
 
2738
  var sub = $('<i class="aam-row-subtitle"></i>');
2747
  sub.append($('<span/>').text(getAAM().__('ID:') + ' '));
2748
  sub.append($('<strong/>').text(data[0].split('|')[0]));
2749
 
2750
+ $('td:eq(1)', row).append(sub);
2751
+ } else if (data[2] === 'tag') {
2752
+ $('td:eq(1)', row).html($('<span/>').text(data[3]));
2753
+
2754
+ var sub = $('<i class="aam-row-subtitle"></i>');
2755
+
2756
+ sub.append($('<span/>').text(getAAM().__('ID:') + ' '));
2757
+ sub.append($('<strong/>').text(data[0].split('|')[0]));
2758
+
2759
  $('td:eq(1)', row).append(sub);
2760
  } else {
2761
  $('td:eq(1)', row).html($('<span/>').text(data[3]));
2831
  'class': 'aam-row-action text-muted icon-pencil'
2832
  }));
2833
  break;
2834
+
2835
+ case 'no-pin':
2836
+ $(container).append($('<i/>', {
2837
+ 'class': 'aam-row-action text-muted icon-pin'
2838
+ }));
2839
+ break;
2840
 
2841
  case 'pin' :
2842
  $(container).append($('<i/>', {
2843
+ 'class': 'aam-row-action icon-pin'
2844
  }).bind('click', function () {
2845
  var _btn = $(this);
2846
  $.ajax(getLocal().ajaxurl, {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vasyltech
3
  Tags: access control, membership, backend menu, user role, restricted content, security, jwt
4
  Requires at least: 4.0
5
  Tested up to: 5.1
6
- Stable tag: 5.9.4
7
 
8
  All you need to manage access to you WordPress websites on frontend, backend and API levels for any role, user or visitors.
9
 
@@ -18,7 +18,7 @@ https://www.youtube.com/watch?v=mj5Xa_Wc16Y
18
  * The only plugin that gives you absolute freedom to define the most granular access to any aspect of your website and most of the feature are free;
19
  * Bullet-proven plugin that is used on over 100,000 websites where all features are well-tested and [documented](https://aamplugin.com/support). Very low amount of support tickets speaks for quality;
20
  * It is the only plugin that gives you the ability to manage access to your website content for any role, individual user and visitors or even define the default access to all posts, pages, custom post types, categories and custom hierarchical taxonomies;
21
- * AAM is [developer oriented plugin](https://aamplugin.com/developers). It has dozens of hooks and configurations. It is integrated with WordPress RESTful and XML-RPC APIs and has numerous abstract layers to simplify coding;
22
  * No ads or other promotional crap. The UI is clean and well crafted so you can focus only on what matters;
23
  * No need to be a "paid" customer to get help. Request support via email or start chat with Google Hangout;
24
  * Some features are limited or available only with [premium extensions](https://aamplugin.com/store). AAM functionality is transparent and you will absolute know when you need to get a premium extension;
@@ -80,6 +80,14 @@ https://www.youtube.com/watch?v=mj5Xa_Wc16Y
80
 
81
  == Changelog ==
82
 
 
 
 
 
 
 
 
 
83
  = 5.9.4 =
84
  * Fixed the bug with incorrectly identifying CPT capabilities
85
  * Fixed the bug with URI Access where there where no way to override wildcard rule
3
  Tags: access control, membership, backend menu, user role, restricted content, security, jwt
4
  Requires at least: 4.0
5
  Tested up to: 5.1
6
+ Stable tag: 5.9.5
7
 
8
  All you need to manage access to you WordPress websites on frontend, backend and API levels for any role, user or visitors.
9
 
18
  * The only plugin that gives you absolute freedom to define the most granular access to any aspect of your website and most of the feature are free;
19
  * Bullet-proven plugin that is used on over 100,000 websites where all features are well-tested and [documented](https://aamplugin.com/support). Very low amount of support tickets speaks for quality;
20
  * It is the only plugin that gives you the ability to manage access to your website content for any role, individual user and visitors or even define the default access to all posts, pages, custom post types, categories and custom hierarchical taxonomies;
21
+ * AAM is developer oriented plugin. It has dozens of hooks and configurations. It is integrated with WordPress RESTful and XML-RPC APIs and has numerous abstract layers to simplify coding;
22
  * No ads or other promotional crap. The UI is clean and well crafted so you can focus only on what matters;
23
  * No need to be a "paid" customer to get help. Request support via email or start chat with Google Hangout;
24
  * Some features are limited or available only with [premium extensions](https://aamplugin.com/store). AAM functionality is transparent and you will absolute know when you need to get a premium extension;
80
 
81
  == Changelog ==
82
 
83
+ = 5.9.5 =
84
+ * Fixed the bug with Access Policy `Param` value that was not evaluating embedded markers
85
+ * Fixed the bug that was causing PHP Warning for users that have none-existing role assigned
86
+ * Fixed the bug with Customizer that was blocking user from publishing changes
87
+ * Added support for `tags` - the ability to manage access to posts by none-hierarchical terms
88
+ * Added the ability to define dynamic Resource names with markers in Access Policies
89
+ * Added new Access Policy marker USERMETA https://aamplugin.com/reference/policy#usermeta
90
+
91
  = 5.9.4 =
92
  * Fixed the bug with incorrectly identifying CPT capabilities
93
  * Fixed the bug with URI Access where there where no way to override wildcard rule