Adobe Commerce 2.3 reached end of support in September 2022.
Adobe Commerce only. Learn more.

Manage company roles

Within a company, customers may have different job roles, levels of responsibility, and access to information about their company. B2B for Adobe Commerce defines several types of system resources, and the Company Admin (or an integration that operates on the behalf of the Company Admin) grants or denies access to these resources using company roles. The Company Admin has access to all resources.

B2B for Adobe Commerce defines the following types of resources:

  • Sales
  • Negotiable quotes
  • Company profile
  • Company user management
  • Company credit

Each of these resources contains a hierarchy of other resources. When a Company Admin grants or blocks access to a resource from the store UI, the action applies to all sub-resources, unless explicitly overridden. However, if you grant or block access using web APIs, you must specify each resource individually.

The following table lists all the resources that are available to the customers defined with a company. To visualize the resource hierarchy, log in to a store as the Company Admin and select Roles and Permissions, then click the Edit action next to the Default User role.

Resource name Display name Hierarchy level
Magento_Company::index All 1
Magento_Sales::all Sales 2
Magento_Sales::place_order Allow Checkout 3
Magento_Sales::payment_account Use Pay On Account method 4
Magento_Sales::view_orders View orders 3
Magento_Sales::view_orders_sub View orders of subordinate users 4
Magento_NegotiableQuote::all Quotes 2
Magento_NegotiableQuote::view_quotes View 3
Magento_NegotiableQuote::manage Request, Edit, Delete 4
Magento_NegotiableQuote::checkout Checkout with Quote 4
Magento_NegotiableQuote::view_quotes_sub View quotes of subordinate users 4
Magento_Company::view Company Profile 2
Magento_Company::view_account Account Information (View) 3
Magento_Company::edit_account Edit 4
Magento_Company::view_address Legal Address (View) 3
Magento_Company::edit_address Edit 4
Magento_Company::contacts Contacts (View) 3
Magento_Company::payment_information Payment Information (View) 3
Magento_Company::shipping_information Shipping Information (View) 3
Magento_Company::user_management Company User Management 2
Magento_Company::roles_view View roles and permissions 3
Magento_Company::roles_edit Manage roles and permissions 4
Magento_Company::users_view View users and teams 3
Magento_Company::users_edit Manage users and teams 4
Magento_Company::credit Company credit 2
Magento_Company::credit_history view 3

Manage company roles

The Company Admin controls the possible actions for each customer within the company by creating common roles with embedded permissions and then assigning them to company users. In most cases, a few roles will be sufficient to cover all the different possible combinations of permissions needed for a company.

Service Name:

companyRoleRepositoryV1

REST Endpoints:

1
2
3
4
5
POST /V1/company/role/
PUT /V1/company/role/:id
GET /V1/company/role/:roleId
DELETE /V1/company/role/:roleId
GET /V1/company/role/

RoleInterface Parameters:

The following table lists the parameters defined in RoleInterface.

Name Description Format Requirements
id The role ID integer Required for updates and deletes
role_name The label assigned to the role string Required to create a role
permissions A list of resources and permissions granted to the role. See the Permissions array table below for details. Array[string] Required to create a role
company_id The company associated with this role integer Required to create a role

Permissions array:

Name Description Format Requirements
id The permission ID generated by Magento. integer Required for updates and deletes
role_id The role ID to which the permission applies. integer Required to create a role
resource_id The internal name of a Magento resource, such as Magento_Sales::place_order. string Required
permission Either allow or deny. string Required

Create a role

This example creates a role named “Junior Buyer”. It allows the assignee to access to all Sales resources except “View orders of subordinate users”.

All resources that are not explicitly allowed are denied. You must specify the Magento_Company::index resource in all calls.

Sample Usage:

POST <host>/rest/<store_code>/V1/company/role

Payload:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "role": {
    "role_name":"Junior Buyer",
    "permissions":[
      {"resource_id": "Magento_Company::index", "permission":"allow"},
      {"resource_id": "Magento_Sales::all", "permission":"allow"},
      {"resource_id": "Magento_Sales::place_order", "permission":"allow"},
      {"resource_id": "Magento_Sales::payment_account", "permission":"allow"},
      {"resource_id": "Magento_Sales::view_orders", "permission":"allow"},
      {"resource_id": "Magento_Sales::view_orders_sub", "permission":"deny"}
      ],
    "company_id": 2
  }
}

Response:

Show code sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
  "id": 6,
  "role_name": "Junior Buyer",
  "permissions": [
    {
      "id": 176,
      "role_id": 6,
      "resource_id": "Magento_Company::index",
      "permission": "allow"
    },
    {
      "id": 177,
      "role_id": 6,
      "resource_id": "Magento_Sales::all",
      "permission": "allow"
    },
    {
      "id": 178,
      "role_id": 6,
      "resource_id": "Magento_Sales::place_order",
      "permission": "allow"
    },
    {
      "id": 179,
      "role_id": 6,
      "resource_id": "Magento_Sales::payment_account",
      "permission": "allow"
    },
    {
      "id": 180,
      "role_id": 6,
      "resource_id": "Magento_Sales::view_orders",
      "permission": "allow"
    },
    {
      "id": 181,
      "role_id": 6,
      "resource_id": "Magento_Sales::view_orders_sub",
      "permission": "deny"
    },
    {
      "id": 182,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::all",
      "permission": "deny"
    },
    {
      "id": 183,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::view_quotes",
      "permission": "deny"
    },
    {
      "id": 184,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::manage",
      "permission": "deny"
    },
    {
      "id": 185,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::checkout",
      "permission": "deny"
    },
    {
      "id": 186,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::view_quotes_sub",
      "permission": "deny"
    },
    {
      "id": 187,
      "role_id": 6,
      "resource_id": "Magento_Company::view",
      "permission": "deny"
    },
    {
      "id": 188,
      "role_id": 6,
      "resource_id": "Magento_Company::view_account",
      "permission": "deny"
    },
    {
      "id": 189,
      "role_id": 6,
      "resource_id": "Magento_Company::edit_account",
      "permission": "deny"
    },
    {
      "id": 190,
      "role_id": 6,
      "resource_id": "Magento_Company::view_address",
      "permission": "deny"
    },
    {
      "id": 191,
      "role_id": 6,
      "resource_id": "Magento_Company::edit_address",
      "permission": "deny"
    },
    {
      "id": 192,
      "role_id": 6,
      "resource_id": "Magento_Company::contacts",
      "permission": "deny"
    },
    {
      "id": 193,
      "role_id": 6,
      "resource_id": "Magento_Company::payment_information",
      "permission": "deny"
    },
    {
      "id": 194,
      "role_id": 6,
      "resource_id": "Magento_Company::user_management",
      "permission": "deny"
    },
    {
      "id": 195,
      "role_id": 6,
      "resource_id": "Magento_Company::roles_view",
      "permission": "deny"
    },
    {
      "id": 196,
      "role_id": 6,
      "resource_id": "Magento_Company::roles_edit",
      "permission": "deny"
    },
    {
      "id": 197,
      "role_id": 6,
      "resource_id": "Magento_Company::users_view",
      "permission": "deny"
    },
    {
      "id": 198,
      "role_id": 6,
      "resource_id": "Magento_Company::users_edit",
      "permission": "deny"
    },
    {
      "id": 199,
      "role_id": 6,
      "resource_id": "Magento_Company::credit",
      "permission": "deny"
    },
    {
      "id": 200,
      "role_id": 6,
      "resource_id": "Magento_Company::credit_history",
      "permission": "deny"
    }
  ],
  "company_id": 2,
  "extension_attributes": []
}

Update a role

Each update call must include all resources the assignee will have access to.

This example call adds access to all Negotiable Quote resources except “View quotes of subordinate users” to the Junior Buyer role.

Sample Usage:

PUT <host>/rest/<store_code>/V1/company/role/6

Payload:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "role": {
    "id": 6,
    "permissions":[
      {"resource_id": "Magento_Company::index", "permission":"allow"},
      {"resource_id": "Magento_Sales::all", "permission":"allow"},
      {"resource_id": "Magento_Sales::place_order", "permission":"allow"},
      {"resource_id": "Magento_Sales::payment_account", "permission":"allow"},
      {"resource_id": "Magento_Sales::view_orders", "permission":"allow"},
      {"resource_id": "Magento_Sales::view_orders_sub", "permission":"deny"},
      {"resource_id": "Magento_NegotiableQuote::all", "permission":"allow"},
      {"resource_id": "Magento_NegotiableQuote::view_quotes", "permission":"allow"},
      {"resource_id": "Magento_NegotiableQuote::manage", "permission":"allow"},
      {"resource_id": "Magento_NegotiableQuote::checkout", "permission":"allow"},
      {"resource_id": "Magento_NegotiableQuote::view_quotes_sub", "permission":"deny"}
      ],
    "company_id": 2
  }
}

Response:

Show code sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
  "id": 6,
  "role_name": "Junior Buyer",
  "permissions": [
    {
      "id": 226,
      "role_id": 6,
      "resource_id": "Magento_Company::index",
      "permission": "allow"
    },
    {
      "id": 227,
      "role_id": 6,
      "resource_id": "Magento_Sales::all",
      "permission": "allow"
    },
    {
      "id": 228,
      "role_id": 6,
      "resource_id": "Magento_Sales::place_order",
      "permission": "allow"
    },
    {
      "id": 229,
      "role_id": 6,
      "resource_id": "Magento_Sales::payment_account",
      "permission": "allow"
    },
    {
      "id": 230,
      "role_id": 6,
      "resource_id": "Magento_Sales::view_orders",
      "permission": "allow"
    },
    {
      "id": 231,
      "role_id": 6,
      "resource_id": "Magento_Sales::view_orders_sub",
      "permission": "deny"
    },
    {
      "id": 232,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::all",
      "permission": "allow"
    },
    {
      "id": 233,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::view_quotes",
      "permission": "allow"
    },
    {
      "id": 234,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::manage",
      "permission": "allow"
    },
    {
      "id": 235,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::checkout",
      "permission": "allow"
    },
    {
      "id": 236,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::view_quotes_sub",
      "permission": "deny"
    },
    {
      "id": 237,
      "role_id": 6,
      "resource_id": "Magento_Company::view",
      "permission": "deny"
    },
    {
      "id": 238,
      "role_id": 6,
      "resource_id": "Magento_Company::view_account",
      "permission": "deny"
    },
    {
      "id": 239,
      "role_id": 6,
      "resource_id": "Magento_Company::edit_account",
      "permission": "deny"
    },
    {
      "id": 240,
      "role_id": 6,
      "resource_id": "Magento_Company::view_address",
      "permission": "deny"
    },
    {
      "id": 241,
      "role_id": 6,
      "resource_id": "Magento_Company::edit_address",
      "permission": "deny"
    },
    {
      "id": 242,
      "role_id": 6,
      "resource_id": "Magento_Company::contacts",
      "permission": "deny"
    },
    {
      "id": 243,
      "role_id": 6,
      "resource_id": "Magento_Company::payment_information",
      "permission": "deny"
    },
    {
      "id": 244,
      "role_id": 6,
      "resource_id": "Magento_Company::user_management",
      "permission": "deny"
    },
    {
      "id": 245,
      "role_id": 6,
      "resource_id": "Magento_Company::roles_view",
      "permission": "deny"
    },
    {
      "id": 246,
      "role_id": 6,
      "resource_id": "Magento_Company::roles_edit",
      "permission": "deny"
    },
    {
      "id": 247,
      "role_id": 6,
      "resource_id": "Magento_Company::users_view",
      "permission": "deny"
    },
    {
      "id": 248,
      "role_id": 6,
      "resource_id": "Magento_Company::users_edit",
      "permission": "deny"
    },
    {
      "id": 249,
      "role_id": 6,
      "resource_id": "Magento_Company::credit",
      "permission": "deny"
    },
    {
      "id": 250,
      "role_id": 6,
      "resource_id": "Magento_Company::credit_history",
      "permission": "deny"
    }
  ],
  "company_id": 2,
  "extension_attributes": []
}

Return all information about a role

This call returns the id, role name, and set of permissions defined within the specified role_id.

Sample Usage:

GET <host>/rest/<store_code>/V1/company/role/6

Payload:

None

Response:

Show code sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
  "id": 6,
  "role_name": "Junior Buyer",
  "permissions": [
    {
      "id": 226,
      "role_id": 6,
      "resource_id": "Magento_Company::index",
      "permission": "allow"
    },
    {
      "id": 227,
      "role_id": 6,
      "resource_id": "Magento_Sales::all",
      "permission": "allow"
    },
    {
      "id": 228,
      "role_id": 6,
      "resource_id": "Magento_Sales::place_order",
      "permission": "allow"
    },
    {
      "id": 229,
      "role_id": 6,
      "resource_id": "Magento_Sales::payment_account",
      "permission": "allow"
    },
    {
      "id": 230,
      "role_id": 6,
      "resource_id": "Magento_Sales::view_orders",
      "permission": "allow"
    },
    {
      "id": 231,
      "role_id": 6,
      "resource_id": "Magento_Sales::view_orders_sub",
      "permission": "deny"
    },
    {
      "id": 232,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::all",
      "permission": "allow"
    },
    {
      "id": 233,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::view_quotes",
      "permission": "allow"
    },
    {
      "id": 234,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::manage",
      "permission": "allow"
    },
    {
      "id": 235,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::checkout",
      "permission": "allow"
    },
    {
      "id": 236,
      "role_id": 6,
      "resource_id": "Magento_NegotiableQuote::view_quotes_sub",
      "permission": "deny"
    },
    {
      "id": 237,
      "role_id": 6,
      "resource_id": "Magento_Company::view",
      "permission": "deny"
    },
    {
      "id": 238,
      "role_id": 6,
      "resource_id": "Magento_Company::view_account",
      "permission": "deny"
    },
    {
      "id": 239,
      "role_id": 6,
      "resource_id": "Magento_Company::edit_account",
      "permission": "deny"
    },
    {
      "id": 240,
      "role_id": 6,
      "resource_id": "Magento_Company::view_address",
      "permission": "deny"
    },
    {
      "id": 241,
      "role_id": 6,
      "resource_id": "Magento_Company::edit_address",
      "permission": "deny"
    },
    {
      "id": 242,
      "role_id": 6,
      "resource_id": "Magento_Company::contacts",
      "permission": "deny"
    },
    {
      "id": 243,
      "role_id": 6,
      "resource_id": "Magento_Company::payment_information",
      "permission": "deny"
    },
    {
      "id": 244,
      "role_id": 6,
      "resource_id": "Magento_Company::user_management",
      "permission": "deny"
    },
    {
      "id": 245,
      "role_id": 6,
      "resource_id": "Magento_Company::roles_view",
      "permission": "deny"
    },
    {
      "id": 246,
      "role_id": 6,
      "resource_id": "Magento_Company::roles_edit",
      "permission": "deny"
    },
    {
      "id": 247,
      "role_id": 6,
      "resource_id": "Magento_Company::users_view",
      "permission": "deny"
    },
    {
      "id": 248,
      "role_id": 6,
      "resource_id": "Magento_Company::users_edit",
      "permission": "deny"
    },
    {
      "id": 249,
      "role_id": 6,
      "resource_id": "Magento_Company::credit",
      "permission": "deny"
    },
    {
      "id": 250,
      "role_id": 6,
      "resource_id": "Magento_Company::credit_history",
      "permission": "deny"
    }
  ],
  "company_id": 2,
  "extension_attributes": []
}

Delete a role

You cannot delete a role if it is the only role defined within the company.

Sample Usage:

DELETE <host>/rest/<store_code>/V1/company/role/5

Payload:

None

Response:

true, indicating the request was successful

Search for a role

The following call returns all roles that have been created for a company (company_id = 2).

See Search using REST APIs for information about constructing a search query.

Sample Usage:

GET <host>/rest/<store_code>/V1/company/role?searchCriteria[filter_groups][0][filters][0][field]=company_id&searchCriteria[filter_groups][0][filters][0][value]=2&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

Payload:

None

Response:

Show code sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
{
    "items": [
        {
            "id": 2,
            "role_name": "Default User",
            "permissions": [
                {
                    "id": 26,
                    "role_id": 2,
                    "resource_id": "Magento_Company::index",
                    "permission": "allow"
                },
                {
                    "id": 27,
                    "role_id": 2,
                    "resource_id": "Magento_Sales::all",
                    "permission": "allow"
                },
                {
                    "id": 28,
                    "role_id": 2,
                    "resource_id": "Magento_Sales::place_order",
                    "permission": "allow"
                },
                {
                    "id": 29,
                    "role_id": 2,
                    "resource_id": "Magento_Sales::payment_account",
                    "permission": "deny"
                },
                {
                    "id": 30,
                    "role_id": 2,
                    "resource_id": "Magento_Sales::view_orders",
                    "permission": "allow"
                },
                {
                    "id": 31,
                    "role_id": 2,
                    "resource_id": "Magento_Sales::view_orders_sub",
                    "permission": "deny"
                },
                {
                    "id": 32,
                    "role_id": 2,
                    "resource_id": "Magento_NegotiableQuote::all",
                    "permission": "allow"
                },
                {
                    "id": 33,
                    "role_id": 2,
                    "resource_id": "Magento_NegotiableQuote::view_quotes",
                    "permission": "allow"
                },
                {
                    "id": 34,
                    "role_id": 2,
                    "resource_id": "Magento_NegotiableQuote::manage",
                    "permission": "allow"
                },
                {
                    "id": 35,
                    "role_id": 2,
                    "resource_id": "Magento_NegotiableQuote::checkout",
                    "permission": "allow"
                },
                {
                    "id": 36,
                    "role_id": 2,
                    "resource_id": "Magento_NegotiableQuote::view_quotes_sub",
                    "permission": "deny"
                },
                {
                    "id": 37,
                    "role_id": 2,
                    "resource_id": "Magento_Company::view",
                    "permission": "allow"
                },
                {
                    "id": 38,
                    "role_id": 2,
                    "resource_id": "Magento_Company::view_account",
                    "permission": "allow"
                },
                {
                    "id": 39,
                    "role_id": 2,
                    "resource_id": "Magento_Company::edit_account",
                    "permission": "deny"
                },
                {
                    "id": 40,
                    "role_id": 2,
                    "resource_id": "Magento_Company::view_address",
                    "permission": "allow"
                },
                {
                    "id": 41,
                    "role_id": 2,
                    "resource_id": "Magento_Company::edit_address",
                    "permission": "deny"
                },
                {
                    "id": 42,
                    "role_id": 2,
                    "resource_id": "Magento_Company::contacts",
                    "permission": "allow"
                },
                {
                    "id": 43,
                    "role_id": 2,
                    "resource_id": "Magento_Company::payment_information",
                    "permission": "allow"
                },
                {
                    "id": 44,
                    "role_id": 2,
                    "resource_id": "Magento_Company::user_management",
                    "permission": "allow"
                },
                {
                    "id": 45,
                    "role_id": 2,
                    "resource_id": "Magento_Company::roles_view",
                    "permission": "deny"
                },
                {
                    "id": 46,
                    "role_id": 2,
                    "resource_id": "Magento_Company::roles_edit",
                    "permission": "deny"
                },
                {
                    "id": 47,
                    "role_id": 2,
                    "resource_id": "Magento_Company::users_view",
                    "permission": "allow"
                },
                {
                    "id": 48,
                    "role_id": 2,
                    "resource_id": "Magento_Company::users_edit",
                    "permission": "deny"
                },
                {
                    "id": 49,
                    "role_id": 2,
                    "resource_id": "Magento_Company::credit",
                    "permission": "deny"
                },
                {
                    "id": 50,
                    "role_id": 2,
                    "resource_id": "Magento_Company::credit_history",
                    "permission": "deny"
                }
            ],
            "company_id": 2
        },
        {
            "id": 3,
            "role_name": "Senior Buyer",
            "permissions": [
                {
                    "id": 51,
                    "role_id": 3,
                    "resource_id": "Magento_Company::index",
                    "permission": "allow"
                },
                {
                    "id": 52,
                    "role_id": 3,
                    "resource_id": "Magento_Sales::all",
                    "permission": "allow"
                },
                {
                    "id": 53,
                    "role_id": 3,
                    "resource_id": "Magento_Sales::place_order",
                    "permission": "allow"
                },
                {
                    "id": 54,
                    "role_id": 3,
                    "resource_id": "Magento_Sales::payment_account",
                    "permission": "allow"
                },
                {
                    "id": 55,
                    "role_id": 3,
                    "resource_id": "Magento_Sales::view_orders",
                    "permission": "allow"
                },
                {
                    "id": 56,
                    "role_id": 3,
                    "resource_id": "Magento_Sales::view_orders_sub",
                    "permission": "allow"
                },
                {
                    "id": 57,
                    "role_id": 3,
                    "resource_id": "Magento_NegotiableQuote::all",
                    "permission": "allow"
                },
                {
                    "id": 58,
                    "role_id": 3,
                    "resource_id": "Magento_NegotiableQuote::view_quotes",
                    "permission": "allow"
                },
                {
                    "id": 59,
                    "role_id": 3,
                    "resource_id": "Magento_NegotiableQuote::manage",
                    "permission": "allow"
                },
                {
                    "id": 60,
                    "role_id": 3,
                    "resource_id": "Magento_NegotiableQuote::checkout",
                    "permission": "allow"
                },
                {
                    "id": 61,
                    "role_id": 3,
                    "resource_id": "Magento_NegotiableQuote::view_quotes_sub",
                    "permission": "allow"
                },
                {
                    "id": 62,
                    "role_id": 3,
                    "resource_id": "Magento_Company::view",
                    "permission": "allow"
                },
                {
                    "id": 63,
                    "role_id": 3,
                    "resource_id": "Magento_Company::view_account",
                    "permission": "allow"
                },
                {
                    "id": 64,
                    "role_id": 3,
                    "resource_id": "Magento_Company::edit_account",
                    "permission": "deny"
                },
                {
                    "id": 65,
                    "role_id": 3,
                    "resource_id": "Magento_Company::view_address",
                    "permission": "allow"
                },
                {
                    "id": 66,
                    "role_id": 3,
                    "resource_id": "Magento_Company::edit_address",
                    "permission": "deny"
                },
                {
                    "id": 67,
                    "role_id": 3,
                    "resource_id": "Magento_Company::contacts",
                    "permission": "allow"
                },
                {
                    "id": 68,
                    "role_id": 3,
                    "resource_id": "Magento_Company::payment_information",
                    "permission": "allow"
                },
                {
                    "id": 69,
                    "role_id": 3,
                    "resource_id": "Magento_Company::user_management",
                    "permission": "allow"
                },
                {
                    "id": 70,
                    "role_id": 3,
                    "resource_id": "Magento_Company::roles_view",
                    "permission": "allow"
                },
                {
                    "id": 71,
                    "role_id": 3,
                    "resource_id": "Magento_Company::roles_edit",
                    "permission": "allow"
                },
                {
                    "id": 72,
                    "role_id": 3,
                    "resource_id": "Magento_Company::users_view",
                    "permission": "allow"
                },
                {
                    "id": 73,
                    "role_id": 3,
                    "resource_id": "Magento_Company::users_edit",
                    "permission": "allow"
                },
                {
                    "id": 74,
                    "role_id": 3,
                    "resource_id": "Magento_Company::credit",
                    "permission": "allow"
                },
                {
                    "id": 75,
                    "role_id": 3,
                    "resource_id": "Magento_Company::credit_history",
                    "permission": "allow"
                }
            ],
            "company_id": 2
        },
        {
            "id": 4,
            "role_name": "Junior Buyer",
            "permissions": [
                {
                    "id": 76,
                    "role_id": 4,
                    "resource_id": "Magento_Company::index",
                    "permission": "allow"
                },
                {
                    "id": 77,
                    "role_id": 4,
                    "resource_id": "Magento_Sales::all",
                    "permission": "allow"
                },
                {
                    "id": 78,
                    "role_id": 4,
                    "resource_id": "Magento_Sales::place_order",
                    "permission": "allow"
                },
                {
                    "id": 79,
                    "role_id": 4,
                    "resource_id": "Magento_Sales::payment_account",
                    "permission": "allow"
                },
                {
                    "id": 80,
                    "role_id": 4,
                    "resource_id": "Magento_Sales::view_orders",
                    "permission": "allow"
                },
                {
                    "id": 81,
                    "role_id": 4,
                    "resource_id": "Magento_Sales::view_orders_sub",
                    "permission": "deny"
                },
                {
                    "id": 82,
                    "role_id": 4,
                    "resource_id": "Magento_NegotiableQuote::all",
                    "permission": "allow"
                },
                {
                    "id": 83,
                    "role_id": 4,
                    "resource_id": "Magento_NegotiableQuote::view_quotes",
                    "permission": "allow"
                },
                {
                    "id": 84,
                    "role_id": 4,
                    "resource_id": "Magento_NegotiableQuote::manage",
                    "permission": "allow"
                },
                {
                    "id": 85,
                    "role_id": 4,
                    "resource_id": "Magento_NegotiableQuote::checkout",
                    "permission": "allow"
                },
                {
                    "id": 86,
                    "role_id": 4,
                    "resource_id": "Magento_NegotiableQuote::view_quotes_sub",
                    "permission": "allow"
                },
                {
                    "id": 87,
                    "role_id": 4,
                    "resource_id": "Magento_Company::view",
                    "permission": "allow"
                },
                {
                    "id": 88,
                    "role_id": 4,
                    "resource_id": "Magento_Company::view_account",
                    "permission": "allow"
                },
                {
                    "id": 89,
                    "role_id": 4,
                    "resource_id": "Magento_Company::edit_account",
                    "permission": "deny"
                },
                {
                    "id": 90,
                    "role_id": 4,
                    "resource_id": "Magento_Company::view_address",
                    "permission": "allow"
                },
                {
                    "id": 91,
                    "role_id": 4,
                    "resource_id": "Magento_Company::edit_address",
                    "permission": "deny"
                },
                {
                    "id": 92,
                    "role_id": 4,
                    "resource_id": "Magento_Company::contacts",
                    "permission": "allow"
                },
                {
                    "id": 93,
                    "role_id": 4,
                    "resource_id": "Magento_Company::payment_information",
                    "permission": "allow"
                },
                {
                    "id": 94,
                    "role_id": 4,
                    "resource_id": "Magento_Company::user_management",
                    "permission": "allow"
                },
                {
                    "id": 95,
                    "role_id": 4,
                    "resource_id": "Magento_Company::roles_view",
                    "permission": "allow"
                },
                {
                    "id": 96,
                    "role_id": 4,
                    "resource_id": "Magento_Company::roles_edit",
                    "permission": "deny"
                },
                {
                    "id": 97,
                    "role_id": 4,
                    "resource_id": "Magento_Company::users_view",
                    "permission": "allow"
                },
                {
                    "id": 98,
                    "role_id": 4,
                    "resource_id": "Magento_Company::users_edit",
                    "permission": "deny"
                },
                {
                    "id": 99,
                    "role_id": 4,
                    "resource_id": "Magento_Company::credit",
                    "permission": "allow"
                },
                {
                    "id": 100,
                    "role_id": 4,
                    "resource_id": "Magento_Company::credit_history",
                    "permission": "allow"
                }
            ],
            "company_id": 2
        }
    ],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "company_id",
                        "value": "2",
                        "condition_type": "eq"
                    }
                ]
            }
        ]
    },
    "total_count": 3
}