Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
fix(tournaments): access levels are fixed and station id cannot be ed…
Browse files Browse the repository at this point in the history
…ited unless you're the owner

closes #83
  • Loading branch information
seiyria committed Oct 31, 2015
1 parent b4670c6 commit 5f979c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/controllers/tournaments/inProgressCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ site.controller('inProgressController', ($scope, $timeout, EnsureLoggedIn, Sideb
const clipboard = new Clipboard('.copy-url');
clipboard.on('success', () => Toaster.show(`Copied URL to clipboard!`));

const defaultHasAccess = () => authData && authData.uid === UserStatus.firebase.playerSetUid;
const defaultHasAccess = () => authData && authData.uid === atob($stateParams.userId);

$scope.hasAccess = defaultHasAccess();

if(authData) {
CurrentUsers.watch.then(null, null, currentUsersInfo => {
const data = currentUsersInfo.users;
if(!data.shareIDs) return;
$scope.hasAccess = defaultHasAccess() || data && data.shareIDs[authData.uid];
$scope.hasAccess = data && data.shareIDs[authData.uid] || defaultHasAccess();
console.log(data, defaultHasAccess(), UserStatus.firebase.playerSetUid, authData);
});
}

Expand Down

0 comments on commit 5f979c2

Please sign in to comment.