What is the difference between _table/ and _table/* in role Access?


#1

Hi all,

In Admin console, in menu: Role > Access

When we assign a “Service Access” to a Role for a SQL connection in the Component’s list, we have for table access (and other components too) two options:
_table/
and
_table/*

When i try to have for my default role (the Guest access) an access to verbs GET and POST to one table (for example table mainki), i first try to select in Component _table/mainki/* . That means for me all fields in that table.
But when i try to make a POST request on it, i receive a 401 (Unauthorized) response.

If i select in the component _table/mainki/ and if i make the same POST request, it return 200 OK !

Ok, i have to use the component without the * but when i was working on some GET requests all goes fine and it doesn’t work only on POST one !

So my question is what the difference between _table/xxx/ and _table/xxx/* ?

cheers,
cesar


#2

Think of it like a folder path, not the content that it returns
So if you have permissions on _table/mytable/
You can make calls to /api/v2/myservice/_table/mytable and nothing further down the path
If you have permissions on _table/mytable/*
then you can make calls on all resources past the table name in the path, such as getting a single record by id: GET /api/v2/myservice/_table/mytable/4, but this does not inherit the _table/mytable/ permission

So if you want your role to have access to both the table name path and resources beyond, you have to have two entries, one for _table/mytable/ and one for _table/mytable/*


#3

Ok Thanks drewpearce!

That’s perfectly clear now when thinking of it as a folder :wink:

cheers,
cesar