Role Permissions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stefan
    Member
    • Jul 2021
    • 57

    Role Permissions

    Hi everyone!

    I would like to enable only certain fields of entities for an API access, i.e. Contact: firstname, lastname.

    I thought I could do this via Role > Field Level Security > Contact: firstname & lastname (read: yes)

    I tried to access via API:

    $crm_data = $client->request('GET', 'Contact', [
    'select' => 'firstName,lastName'
    ]);

    But unfortunately, this does not work.

    Only when I also allow 'read all' under Scope Level > Contact, the API call works. But then all fields can be accessed.

    But if I only want firstname & lastname to be accessible, do I have to manually prohibit all other fields (over 90) atField Level Security, or is there a better solution?

    Many thanks in advance,
    Stefan
  • yuri
    Member
    • Mar 2014
    • 8485

    #2
    Hi,

    Yes. You need to add all fields. It v8.2 there will be the ability to add multiple fields at once.

    If it's only for API usage, you can write your own API endpoint that will return only needed data.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Stefan
      Member
      • Jul 2021
      • 57

      #3
      Alright, thank you yuri!

      Comment

      Working...