Last active
February 3, 2016 12:57
-
-
Save jenkoian/33e87298a93f5eb17f02 to your computer and use it in GitHub Desktop.
Legacy escape route mapRolesSnippet.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
/** | |
* Map legacy roles to symfony roles. Legacy roles are in following format: | |
* ['moderator' => '1'] | |
*/ | |
private function mapRoles() | |
{ | |
if (empty($this->legacyRoles)) { | |
return; | |
} | |
foreach ($this->legacyRoles as $roleName => $roleValue) { | |
if ($roleValue === '1') { | |
$this->roles[] = 'ROLE_' . strtoupper($roleName); | |
} | |
} | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment