Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
Oops, not an update
Browse files Browse the repository at this point in the history
  • Loading branch information
Regis Kuckaertz committed Feb 19, 2018
1 parent e9176f4 commit 5bd6b6f
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -42,10 +42,10 @@ class PermissionsStore(config: PermissionsConfig, provider: Option[PermissionsSt

def list(implicit user: PermissionsUser): Future[PermissionsMap] = {
if (config.enablePermissionsStore)
storeProvider.store.modify {
case PermissionsStoreModel.empty => Failure(PermissionsStoreEmptyException())
case s: PermissionsStoreModel => Success(s)
}.map(s => s.defaultsMap ++ s.userOverrides.getOrElse(user.userId.toLowerCase, Map.empty))
Future.successful(storeProvider.store.get).flatMap {
case PermissionsStoreModel.empty => Future.failed(PermissionsStoreEmptyException())
case s: PermissionsStoreModel => Future.successful(s.defaultsMap ++ s.userOverrides.getOrElse(user.userId.toLowerCase, Map.empty))
}

else Future.failed(PermissionsStoreDisabledException())
}
Expand Down

0 comments on commit 5bd6b6f

Please sign in to comment.