PluginProbe ʕ •ᴥ•ʔ
Security Optimizer – The All-In-One Protection Plugin / 1.5.9
Security Optimizer – The All-In-One Protection Plugin v1.5.9
1.6.2 1.6.1 trunk 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0
sg-security / core / Helper / User_Roles_Trait.php
sg-security / core / Helper Last commit date
Helper.php 4 months ago User_Roles_Trait.php 4 months ago
User_Roles_Trait.php
28 lines
1 <?php
2 namespace SG_Security\Helper;
3
4 use SG_Security\Options_Service\Options_Service;
5 /**
6 * Trait used for factory pattern in the plugin.
7 */
8 trait User_Roles_Trait {
9
10 /**
11 * Roles that should be forced to use 2FA.
12 *
13 * @var array
14 */
15 public static function get_admin_user_roles() {
16 $roles = array(
17 'editor',
18 'administrator',
19 );
20
21 if ( Options_Service::is_enabled( 'sg2fa' ) ) {
22 $roles = apply_filters( 'sg_security_2fa_roles', $roles );
23 }
24
25 return $roles;
26 }
27 }
28