Changes

From SimplyBook.me
Line 777: Line 777:  
<code>getCurrentUserDetails()</code>
 
<code>getCurrentUserDetails()</code>
   −
No arguments.
+
No arguments. Returns Object.
Returns Array.
     −
Returns current logged user info
+
Returns an object with information about logged in user. Note: you are responsible for implementation of some
 +
access rights based on <code>group</code> property value. Most of API methods returns an error if user has low access
 +
rights but not all. There are 4 roles:
 +
 
 +
* '''Administrator''' - have full access to the system
 +
* '''Senior Employee''' - have access to calendar, services and providers, and can modify bookings related with user
 +
* '''Junior Employee''' - can access caledar (but only to own bookings), services associated with user
 +
* '''Viewer''' - have only access to calendar and services in read only mode
 +
 
 +
 
 +
<code>group</code> property can be one of the values:
 +
 
 +
* <code>shop_user</code> - "Senior Employee" access role
 +
* <code>station_user</code> - "Junior Employee" access role
 +
* <code>admin</code> - "Administrator" access role
 +
* <code>viewer</code> - "Viewer" access role
 +
* <code>reseller_company_admin</code> - reserved
 +
 
 +
 
 +
Example:
 +
 
 +
  {
 +
    "id": 1,
 +
    "login": admin,
 +
    "email": "admin@mycoolcompany.com";
 +
    "firstname": "Michail",
 +
    "lastname": " ",
 +
    "phone": "",
 +
    "group": "admin",
 +
    "is_blocked": 0,
 +
    "last_access_time": "2016-06-06 17:55:51",
 +
    "unit_group_id": null
 +
  }