Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC-32057: BAPI authorization alignment with latest updates. #2487

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ $config[AgentSecurityBlockerMerchantPortalConstants::AGENT_MERCHANT_PORTAL_BLOCK

<details>
<summary>src/Pyz/Zed/Acl/AclConfig.php</summary>

```php
<?php

Expand Down Expand Up @@ -117,6 +118,7 @@ class AclConfig extends SprykerAclConfig
}
}
```

</details>

**src/Pyz/Zed/AclMerchantAgent/AclMerchantAgentConfig.php**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,22 @@ class OauthWarehouseUserConfig extends SprykerOauthWarehouseUserConfig
*
* @return array<string, mixed>
*/
public function getAllowedForWarehouseUserPaths(): array
public function getAllowedForWarehouseUserPaths(): array
{
return [
'/\/picking-lists.*/' => [
'/\/warehouse-user-assignments(?:\/[^\/]+)?\/?$/' => [
'isRegularExpression' => true,
'methods' => [
'get',
'getCollection',
'patch',
],
],
'/\/warehouse-user-assignments(?:\/[^\/]+)?\/?$/' => [
'/\/picking-lists.*/' => [
'isRegularExpression' => true,
'methods' => [
'patch',
],
],
'/push-notification-subscriptions' => [
'isRegularExpression' => false,
Expand All @@ -186,9 +194,47 @@ class OauthWarehouseUserConfig extends SprykerOauthWarehouseUserConfig
}
}
```

</details>

3. Optional: To give any type of users access to the backend API endpoints that are protected by the `WarehouseTokenAuthorizationStrategy` strategy, set the following module configuration:

**src/Pyz/Zed/OauthWarehouse/OauthWarehouseConfig.php**
```php
<?php

namespace Pyz\Zed\OauthWarehouse;

use Spryker\Zed\OauthWarehouse\OauthWarehouseConfig as SprykerOauthWarehouseConfig;

class OauthWarehouseConfig extends SprykerOauthWarehouseConfig
{
/**
* @uses \Spryker\Zed\OauthUserConnector\OauthUserConnectorConfig::SCOPE_BACK_OFFICE_USER
*
* @var string
*/
protected const SCOPE_BACK_OFFICE_USER = 'back-office-user';

/**
* @uses \Spryker\Zed\OauthWarehouseUser\OauthWarehouseUserConfig::SCOPE_WAREHOUSE_USER
*
* @var string
*/
protected const SCOPE_WAREHOUSE_USER = 'warehouse-user';

/**
* @return list<string>
*/
public function getAllowedUserScopes(): array
{
return [
static::SCOPE_BACK_OFFICE_USER,
static::SCOPE_WAREHOUSE_USER,
];
}
}
```

## 4) Add translations

1. Append glossary according to your configuration:
Expand Down
Loading