These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Is there a way to check what permissions you have (From a user's API) before you query XMLs?

Author
Alexis Prey
The Scope
Gallente Federation
#1 - 2011-09-15 10:16:35 UTC
I'd like to be able to tell a corp leader what information the user has given him or her access too. Is there somewhere I can get this information, or do I have to query everything, and just find out when it gives error?

I tried API Key Info, but it didn't give me anything usefull.
Lutz Major
Austriae Est Imperare Orbi Universo
#2 - 2011-09-15 10:30:35 UTC  |  Edited by: Lutz Major
Just compare test the bitmask of the accessMask of the ApiKeyInfo with the accessMask of the requests
Alexis Prey
The Scope
Gallente Federation
#3 - 2011-09-15 10:32:23 UTC
Lutz Major wrote:
Just compare test the bitmask of the accessMask of the ApiKeyInfo with the accessMask of the requests


Very helpful. Thanks so much
Alexis Prey
The Scope
Gallente Federation
#4 - 2011-09-15 10:48:05 UTC
Okay, I'm sorry, I take it back. I understand that I can somehow compare the number I got with these numbers... But after looking at it, I'm lost. How can I test the mask I got with this mask? I did try to research on my own, but even my programmer friend who usually knows everything is confused.
Artem Valiant
NecroRise Squadron
Galaxy Spiritus
#5 - 2011-09-15 12:55:56 UTC
Alexis Prey wrote:
Okay, I'm sorry, I take it back. I understand that I can somehow compare the number I got with these numbers... But after looking at it, I'm lost. How can I test the mask I got with this mask? I did try to research on my own, but even my programmer friend who usually knows everything is confused.


Use operation 'bitwise AND'
For example:
Your mask 73404417
You want to call Char/Contracts. Required mask for this request is 67108864.
73404417 AND 67108864 = 67108864
But, if you want to call MarketOrders (with mask 4096)
73404417 AND 4096 = 0
Aethlyn
Brutor Tribe
Minmatar Republic
#6 - 2011-09-15 13:12:39 UTC  |  Edited by: Aethlyn
To do it with the Windows Calculator (calc.exe; requires Windows Vista or Windows 7 - I'm not sure about the version of Windows XP):
  • Hit Alt+2 to toggle to programmer view.
  • Make sure on the left 'Dec' is selected (should be default).
  • Type the number retrieved with the API key.
  • Hit the button 'And' (bottom center).
  • Now type the number you've got from the request list matching the part you're interested in (e.g. 4096 for Market orders).
  • Hit '='.
  • If the result is '0', that access is not included in the key; if the result is once again the ID you entered before, access is granted.

Looking for more thoughts? Follow me on Twitter.