private function buildPermissionsMap()
    {
        $permissionsMap = [];
        $roles          = $this->roles()->with('permissions')->get()->toArray();
        foreach ($roles as $role) {
            if (!empty($role['permissions'])) {
                foreach ($role['permissions'] as $permission) {
                    $permissionsMap[] = $permission['name'];
                }
            }
        }
        return array_unique($permissionsMap);
    }