Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

345 - NHT: Users shall be able to create stats. #357

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rlmcneary2
Copy link

  • Upgrade DB script adds a creatorId column to the DB.
  • Added the creatorId to a stat to capture the user that created the stat.
  • Logged in user's can now create stats.
  • If a user is logged in they will see the delete icon for stats they created.
  • If an admin is logged in they can delete stats that anyone has created.
  • Updated the server to delete stats only when the stat was created by the current user or the current user is an admin.

@@ -225,7 +225,7 @@ export const ViewModel = DefineMap.extend('GameDetailsVM',
* ```
*/
showStatMenuFor: function(player, element, event){
if(!this.session || !this.session.isAdmin()) {
if(!this.session.user) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restore check for session existence

}

return function ( req, res, next ) {
if ( req.user ) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only for verified user's

return Promise.all([stat, stat.get("creatorId")]);
})
.then(([stat, creatorId]) => {
debugger;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant