public function getRolesAssignedByPermission($permission_name)
    {
        $roles = user_roles();
        $roles_found = [];
        foreach ($roles as $role) {
            if ($role->hasPermission($permission_name)) {
                $roles_found[] = $role->getOriginalId();
            }
        }
        return $roles_found;
    }
public function getRolesAssignedByPermission($permission_name)
    {
        $roles = user_roles();
        $roles_found = [];
        foreach ($roles as $role) {
            if ($role->hasPermission($permission_name)) {
                $roles_found[] = $role->getOriginalId();
            }
        }
        return $roles_found;
    }
public function getRolesAssignedByPermission ( $ permission_name ) { $ roles = user_roles ( ) ; $ roles_found = [ ] ; foreach ( $ roles as $ role ) { if ( $ role -> hasPermission ( $ permission_name ) ) { $ roles_found [ ] = $ role -> getOriginalId ( ) ; } } return $ roles_found ; }
Get user roles Assigned by Permission.

@param string $permission_name
Permission Name.

@return array
User roles filtered by permission else empty array.
Get user roles Assigned by Permission .