Skip to content
Snippets Groups Projects
Commit cf4c12d2 authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-4954: changing getting yaml to use Drupal's function and moving yml files into root

parent 0974f04c
No related branches found
No related tags found
1 merge request!133Feature/istwcms 4954 ebremner features
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Drupal\uw_cfg_common\UwRoles; namespace Drupal\uw_cfg_common\UwRoles;
use Drupal\user\Entity\Role; use Drupal\user\Entity\Role;
use Drupal\Component\Serialization\Yaml;
/** /**
* Class UwRoles. * Class UwRoles.
...@@ -131,10 +132,10 @@ class UwRoles { ...@@ -131,10 +132,10 @@ class UwRoles {
public static function getUwPermissions(string $rid): array { public static function getUwPermissions(string $rid): array {
// Get the file to the user role permissions yml file. // Get the file to the user role permissions yml file.
$file = drupal_get_path('module', 'uw_cfg_common') . '/src/UwRoles/yml/user.role.' . $rid . '.yml'; $file = __DIR__ . '/user.role.' . $rid . '.yml';
// Parse the yml file to get the permissions. // Parse the yml file to get the permissions.
$permissions = yaml_parse_file($file); $permissions = Yaml::decode(file_get_contents($file));
// Return the permissions for the specific user. // Return the permissions for the specific user.
return $permissions['permissions']; return $permissions['permissions'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment