src/OrchardCore/OrchardCore.Contents.Core/ContentTypePermissionsHelper.cs
/// <summary>
/// Generates a permission dynamically for a content type
/// </summary>
Generates a permission dynamically for a content type
Generates a permission dynamically for a content type
public static Permission CreateDynamicPermission(Permission template, ContentTypeDefinition typeDefinition)
        {
            return new Permission(
                String.Format(template.Name, typeDefinition.Name),
                String.Format(template.Description, typeDefinition.DisplayName),
                (template.ImpliedBy ?? new Permission[0]).Select(t => CreateDynamicPermission(t, typeDefinition))
            )
            {
                Category = typeDefinition.DisplayName
            };
        }
public static Permission CreateDynamicPermission ( Permission template , ContentTypeDefinition typeDefinition ) { return new Permission ( String . Format ( template . Name , typeDefinition . Name ) , String . Format ( template . Description , typeDefinition . DisplayName ) , ( template . ImpliedBy ?? new Permission [ 0 ] ) . Select ( t => CreateDynamicPermission ( t , typeDefinition ) ) ) { Category = typeDefinition . DisplayName } ; }
Generates a permission dynamically for a content type
Generates a permission dynamically for a content type
template
Permission
typeDefinition
ContentTypeDefinition