Merge pull request #2063 from lbke/bugfix/withAccess-guests

Allow "guests" in withAccess
This commit is contained in:
Sacha Greif 2018-09-12 10:16:40 +09:00 committed by GitHub
commit 27aaf06865
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,7 @@ export default function withAccess (options) {
// if there are any groups defined check if user belongs, else just check if user exists // if there are any groups defined check if user belongs, else just check if user exists
canAccess = currentUser => { canAccess = currentUser => {
return groups ? currentUser && Users.isMemberOf(currentUser, groups) : currentUser; return groups ? Users.isMemberOf(currentUser, groups) : currentUser;
} }
// redirect on constructor if user cannot access // redirect on constructor if user cannot access