question

vrevchenko avatar image
vrevchenko asked

Can i receive email of logged in user in Game Manager?

Good evening.

User from my team has logged in via Game Manager and trying to run some function from CloudScript. Can i somehow store get his login email, username or whatever (for analytics purposes, for example)?

Account ManagementCloudScriptgame manager
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Andy avatar image
Andy answered

It sounds like what you need is for your game client to prompt the user for an email address and then call AddOrUpdateContactEmail (https://api.playfab.com/documentation/client/method/AddOrUpdateContactEmail). That will link the entered address to the player's account and ensure it can be retrieved from the user context on any cloudscript or other client API calls.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vrevchenko avatar image vrevchenko commented ·

@Andy thanks for your answer, but thats not it.

I will try to describe situation step by step.

1) User goes to developer.playfab.com

2) User logins with manager role, for example

3) User goes to Automation => Scheduled Tasks and trying to run AddCoins function, for example

3) At AddCoins function i want to check if user has permission to call this function, i.e. list of users with permission to call this function contains current user email.

Is it possible?

Thanks in advance.

0 Likes 0 ·
Andy avatar image Andy ♦♦ commented ·

Wow, I totally misunderstood your original question. Sorry!

I think what you're after is our role-based permissions system in GameManager. You can read more about it in the blog post here: https://api.playfab.com/blog/user-roles-on-developer-accounts. In your example, you would be able to set users such that they cannot execute your scheduled tasks.

Further, as you may be aware, you can audit which tasks have been executed by which users right on the scheduled tasks page. Changes to scheduled tasks and other entities are tracked on the Audit History Tab under the Admin section.

0 Likes 0 ·
vrevchenko avatar image vrevchenko Andy ♦♦ commented ·

Thanks, @Andy

This is closer to the goal, but again, not exactly it.

With user roles i can only enable/disable ability to watch, edit and run scheduled tasks, but i can not toggle permissions between scheduled tasks.

For example, i have two custom roles: Simple Manager and Main Manager; also, i have two functions on scheduled tasks: SendGift, StartEvent.

What i want is:

Simple Manager can run only SendGift function

Main Manager can run both functions

Is there any way to implement this?

My thought was to implement list with emails for Simple Managers, and list with emails for Main Managers. When someone of them are trying to run a task, i will check at start of the function if person with this email in the list of persons, who can run this task; if he is not - throw an exception like "You have not enough permissions to run this task".

Hope it is clear now.

Best regards, Vlad.

0 Likes 0 ·
Andy avatar image Andy ♦♦ vrevchenko commented ·

Unfortunately, no, we do not support passing developer account information into cloudscript or the more granular permissions system that you're trying to replicate. Entity-based permissions is something that's on our wishlist, but we don't have any upcoming changes to discuss right now.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.