Skip to content

Commit

Permalink
Move files, folders and sorting of b2b extensions (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isengo1989 authored Oct 27, 2023
1 parent a4eb56f commit d32b093
Show file tree
Hide file tree
Showing 54 changed files with 71 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ nav:
---

## Introduction
A new "Customer Specific Features" section on the Customer detail page allows the shop merchant to turn B2B features on or off for a specific customer. This section aims to provide each customer with their own set of specific features, granting them access to certain B2B components within the shop.
A new "Customer-specific features" section on the Customer detail page allows the shop merchant to turn B2B features on or off for a specific customer. This section aims to provide each customer with their own set of specific features, granting them access to certain B2B components within the shop.

![Feature Toggles](../../../../assets/b2b-feature-toggles.png)

To achieve this, ACL (Access Control List) and address the following cases where functionality may be hidden:

1. If the merchant has not activated a feature for a particular customer, it should be hidden.
2. If the b2b admin has not granted an employee access to a specific feature, it should not be visible.
2. If the B2B admin has not granted an employee access to a specific feature, it should not be visible.

Considering these scenarios, we can ensure that the appropriate B2B features are displayed and accessible based on feature toggles and admin-granted permissions.

Expand All @@ -31,7 +31,7 @@ To improve organization and maintain a clear structure, it is advisable to reloc

To ensure consistency and clarity, it is recommended to make your B2B Component extend CommercialB2BBundle instead of CommercialBundle as usual and add the type => 'B2B' attribute inside the describeFeatures() method of each B2B Component. This attribute will help identify and categorize the features specifically related to B2B functionality.

By including `type => 'B2B'` in the `describeFeatures()` method, you can easily distinguish B2B features from other types of features within your application. This will facilitate easier maintenance, organization, and identification of B2B-related functionalities, ensuring a streamlined development process.
By including `type => 'B2B'` in the `describeFeatures()` method, you can distinguish B2B features from other types of features within your application. This will facilitate easier maintenance, organization, and identification of B2B-related functionalities, ensuring a streamlined development process.

For example, consider the following code snippet:

Expand Down Expand Up @@ -118,11 +118,10 @@ class CustomerSpecificFeatureTwigExtension extends AbstractExtension
}
```

Then, use it to check if a specific feature is allowed for a given customer in Twig.
Use it to check if a specific feature is allowed for a given customer in Twig.

```html
{% if customerHasFeature('QUICK_ORDER') %}
...
{% endif %}
```

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ nav:

# Guides

The following articles will guide you in creating custom toggles via a plugin for the b2b components (Customer Specific Features).
The following articles will guide you how to create custom toggles via a plugin for b2b components (Customer-specific features).
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
nav:
title: Concepts
position: 10

---

# Concepts

This section includes the concepts related to Employee Management.

## Additional info

It's important to keep in mind that employees are uniquely identified via their email address.
When a new employee gets invited, a check will be performed to ensure that the email address is in use only once.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
nav:
title: B2B Employee invite / registration
position: 20

---

# B2B Employee invite / registration

Employees can be created via storefront and api to get an invite mail. This has to be later confirmed by the employee to set a password.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
nav:
title: B2B Roles
position: 30

---

# B2B Roles

Roles can be used to bind multiple permission to employees with contexts. Every employee can have one assigned role. Based on that role and the containing permission, the employee will get access to certain information and functionalities.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
nav:
title: Create permissions via App
position: 40

---

# Create Permissions via App

App needs to use the API to extend and create permissions. Therefore, the apps can send a request to the Store API and pass the required parameters to [`/store-api/permission`]() route.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
nav:
title: Create permissions via plugin
position: 20
position: 50

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# B2B permissions
---
nav:
title: Guides
position: 10

---

# Guides

The following articles gives you an idea of roles. Also it guides you on creating your own permissions via app or plugin for the B2B Employee Management component.

## B2B permissions

Use permissions to restrict access to certain information or functionalities within the B2B Components. For example, the B2B supervisor can restrict which employee can manage the company's employee accounts.

## Groups
### Groups
Permissions are divided into individual groups that have a logical relationship to each other.

## Dependencies
### Dependencies
A permission can be dependent on another permission, without which this permission cannot be used. For example, if a role is created with the permission to edit employee accounts, this role must also have the permission to view employee accounts. This is because the `employee.edit` permission depends on the `employee.read` permission.

## Shopware base permissions
### Shopware base permissions
The following permissions are already included and used in the B2B Employee Management component. More "base" permissions will be duly added with future B2B Components.

|Group|Permission|Dependencies|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
nav:
title: Employee Management
position: 10

---

# Employee Management

A feature of the B2B components includes employee, role, and permission management. It is implemented into both Storefront and Administration and supports their respective APIs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
nav:
title: B2B components
position: 30

---

# B2B components

The B2B Components allow merchants to selectively choose and configure B2B capabilities according to their needs. They offer merchants the ability to craft a tailored B2B ecommerce experience for their business partners while also allowing agencies to fine-tune Shopware to meet specific requirements. This means that B2B components can be individually activated or deactivated for each business partner.
Expand Down
File renamed without changes.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions products/extensions/b2b/index.md

This file was deleted.

0 comments on commit d32b093

Please sign in to comment.