@ -236,87 +236,66 @@ When you write this code inside your permission definition provider, it finds th
> Tip: It is better to check the value returned by the `GetPermissionOrNull` method since it may return null if the given permission was not defined.
### Permission depending on a Condition
You may want to disable a permission based on a condition. Disabled permissions are not visible on the UI and always returns `prohibited` when you check them
Permission conditions can be managed according to a condition such as a Feature, Global Feature, or a custom condition. Any condition which implements `IPermissionStateProvider` can be added via calling `AddStateProvider()` method for **PermissionDefinition**.
See examples below:
- To depend on a Global Feature
```csharp
var authorPermission = myGroup.AddPermission("Author_Management");
Custom condition class have to implement `IPermissionStateProvider`.
- Also State Providers can be configured globally via using `GlobalStateProviders` in **AbpPermissionOptions**
```csharp
Configure<AbpPermissionOptions>(options =>
### Permission Depending on a Condition
You may want to disable a permission based on a condition. Disabled permissions are not visible on the UI and always returns `prohibited` when you check them. There are two built-in conditional dependencies for a permission definition;
* A permission can be automatically disabled if a [Feature](Features.md) was disabled.
* A permission can be automatically disabled if a [Global Feature](Global-Features.md) was disabled.
In addition, you can create your custom extensions.
#### Depending on a Features
Use the `RequireFeatures` extension method on your permission definition to make the permission available only if a given feature is enabled:
````csharp
myGroup.AddPermission("Book_Creation")
.RequireFeatures("BookManagement");
````
#### Depending on a Global Feature
Use the `RequireFeatures` extension method on your permission definition to make the permission available only if a given feature is enabled:
````csharp
myGroup.AddPermission("Book_Creation")
.RequireGlobalFeatures("BookManagement");
````
#### Creating a Custom Permission Dependency
Any class implements the `IPermissionStateProvider` interface can disable a permission based on a custom condition.
**Example:**
````csharp
public class MyCustomPermissionStateProvider : IPermissionStateProvider
{
public Task<bool> IsEnabledAsync(PermissionStateContext context)