Skip to content

Commit

Permalink
Merge branch 'main' into ma/widget-permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Dec 18, 2024
2 parents f3b9c1c + 07bc378 commit ba6ac27
Show file tree
Hide file tree
Showing 115 changed files with 318 additions and 304 deletions.
2 changes: 1 addition & 1 deletion CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Code of Conduct

See [Contributing to Orchard Core](https://docs.orchardcore.net/en/latest/guides/contributing/) on the documentation site.
See [Contributing to Orchard Core](https://docs.orchardcore.net/en/latest/contributing/) on the documentation site.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# How to contribute

See [Contributing to Orchard Core](https://docs.orchardcore.net/en/latest/guides/contributing/) on the documentation site.
See [Contributing to Orchard Core](https://docs.orchardcore.net/en/latest/contributing/) on the documentation site.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ We're here to help you succeed with Orchard Core!

## Contributing

It's great that you're thinking about contributing to Orchard Core! You'd join [our wonderful community of contributors](https://docs.orchardcore.net/en/latest/community/).
It's great that you're thinking about contributing to Orchard Core! You'd join [our wonderful community of contributors](https://docs.orchardcore.net/en/latest/community/contributors/).

Check out the docs [on contributing to Orchard Core](https://docs.orchardcore.net/en/latest/guides/contributing/).
Check out the docs [on contributing to Orchard Core](https://docs.orchardcore.net/en/latest/contributing/).

## Preview Package Feed

Expand All @@ -78,7 +78,7 @@ Cloudsmith is the only fully hosted, cloud-native, universal package management

## Code of Conduct

See [our Code of Conduct](https://docs.orchardcore.net/en/latest/guides/contributing/#code-of-conduct).
See [our Code of Conduct](https://docs.orchardcore.net/en/latest/contributing/#code-of-conduct).

## .NET Foundation

Expand Down
269 changes: 132 additions & 137 deletions mkdocs.yml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/OrchardCore.Cms.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
//"OrchardCore_ContentLocalization_CulturePickerOptions": {
// "CookieLifeTime": 14 // Set the culture picker cookie life time (in days).
//},
// See https://docs.orchardcore.net/en/latest/reference/core/Data/#sqlite.
// See https://docs.orchardcore.net/en/latest/reference/modules/Data/#sqlite.
//"OrchardCore_Data_Sqlite": {
// "UseConnectionPooling": false
//},
// See https://docs.orchardcore.net/en/latest/reference/core/Data/#database-table to configure database table presets used before a given tenant is setup.
// See https://docs.orchardcore.net/en/latest/reference/modules/Data/#database-table to configure database table presets used before a given tenant is setup.
//"OrchardCore_Data_TableOptions": {
// "DefaultDocumentTable": "Document", // Document table name, defaults to 'Document'.
// "DefaultTableNameSeparator": "_", // Table name separator, one or multiple '_', "NULL" means no separator, defaults to '_'.
// "DefaultIdentityColumnSize": "Int64" // Identity column size, 'Int32' or 'Int64', defaults to 'Int64'.
//},
// See https://docs.orchardcore.net/en/latest/reference/core/Data/#configuring-yessql to configure YesSql.
// See https://docs.orchardcore.net/en/latest/reference/modules/Data/#configuring-yessql to configure YesSql.
//"OrchardCore_YesSql": {
// "CommandsPageSize": 500,
// "QueryGatingEnabled": true,
Expand Down Expand Up @@ -116,7 +116,7 @@
// "PermissionsPolicy": { "fullscreen": "self" },
// "ReferrerPolicy": "no-referrer"
//},
// See https://docs.orchardcore.net/en/latest/reference/core/Shells/#enable-azure-shells-configuration to configure shell and tenant configuration in Azure Blob Storage.
// See https://docs.orchardcore.net/en/latest/reference/modules/Shells/#enable-azure-shells-configuration to configure shell and tenant configuration in Azure Blob Storage.
// Add a reference to the OrchardCore.Shells.Azure NuGet package.
// Add '.AddAzureShellsConfiguration()' to your Host Startup AddOrchardCms() section.
//"OrchardCore_Shells_Azure": {
Expand All @@ -125,7 +125,7 @@
// "BasePath": "some/base/path", // Optionally, set to a subdirectory inside your container.
// "MigrateFromFiles": true // Optionally, enable to migrate existing App_Data files to Blob automatically.
//},
// See https://docs.orchardcore.net/en/latest/reference/core/Shells/#enable-database-shells-configuration to configure shell and tenant configuration in the database store.
// See https://docs.orchardcore.net/en/latest/reference/modules/Shells/#enable-database-shells-configuration to configure shell and tenant configuration in the database store.
// Add '.AddDatabaseShellsConfiguration()' to your Host Startup AddOrchardCms() section.
//"OrchardCore_Shells_Database": {
// "DatabaseProvider": "SqlConnection", // Set to a supported database provider.
Expand Down
35 changes: 33 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Roles/Recipes/RolesStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,33 @@ protected override async Task HandleAsync(RecipeExecutionContext context)
if (role is Role r)
{
r.RoleDescription = roleEntry.Description;
r.RoleClaims.RemoveAll(c => c.ClaimType == Permission.ClaimType);

if (roleEntry.PermissionBehavior == PermissionBehavior.Replace)
{
// At this point, we know we are replacing permissions.
// Remove all existing permission so we can add the replacements later.
r.RoleClaims.RemoveAll(c => c.ClaimType == Permission.ClaimType);
}

if (!await _systemRoleNameProvider.IsAdminRoleAsync(roleName))
{
r.RoleClaims.AddRange(roleEntry.Permissions.Select(RoleClaim.Create));
if (roleEntry.PermissionBehavior == PermissionBehavior.Remove)
{
// Materialize this list to prevent an exception.
var permissions = r.RoleClaims.Where(c => c.ClaimType == Permission.ClaimType && roleEntry.Permissions.Contains(c.ClaimValue)).ToArray();

foreach (var permission in permissions)
{
r.RoleClaims.Remove(permission);
}
}
else
{
var permissions = roleEntry.Permissions.Select(RoleClaim.Create)
.Where(newClaim => !r.RoleClaims.Exists(existingClaim => existingClaim.ClaimType == newClaim.ClaimType && existingClaim.ClaimValue == newClaim.ClaimValue));

r.RoleClaims.AddRange(permissions);
}
}
}

Expand Down Expand Up @@ -83,4 +105,13 @@ public sealed class RolesStepRoleModel
public string Description { get; set; }

public string[] Permissions { get; set; }

public PermissionBehavior PermissionBehavior { get; set; }
}

public enum PermissionBehavior
{
Replace,
Add,
Remove,
}
2 changes: 1 addition & 1 deletion src/OrchardCore.Modules/OrchardCore.Tenants/Manifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[assembly: Feature(
Id = "OrchardCore.Tenants.Distributed",
Name = "Distributed Tenants",
Description = "Keeps in sync tenants states, needs a distributed cache e.g. 'Redis Cache' and a stateless configuration, see: https://docs.orchardcore.net/en/latest/reference/core/Shells/index.html",
Description = "Keeps in sync tenants states, needs a distributed cache e.g. 'Redis Cache' and a stateless configuration, see: https://docs.orchardcore.net/en/latest/reference/modules/Shells/index.html",
Category = "Distributed",
DefaultTenantOnly = true
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class WorkflowEditor extends WorkflowCanvas {
const outcome1 = outcomes1[i];
const outcome2 = outcomes2[i];

if (outcome1.name != outcome2.displayName || outcome1.displayName != outcome2.displayName) {
if (outcome1.name != outcome2.name || outcome1.displayName != outcome2.displayName) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ var WorkflowEditor = /** @class */function (_super) {
for (var i = 0; i < outcomes1.length; i++) {
var outcome1 = outcomes1[i];
var outcome2 = outcomes2[i];
if (outcome1.name != outcome2.displayName || outcome1.displayName != outcome2.displayName) {
if (outcome1.name != outcome2.name || outcome1.displayName != outcome2.displayName) {
return false;
}
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
namespace OrchardCore.Data;

/// <summary>
/// Sqlite-specific configuration for the Orchard Core database.
/// See <see href="https://docs.orchardcore.net/en/latest/reference/core/Data/#sqlite" />.
/// Sqlite-specific configuration for the Orchard Core database.
/// See <see href="https://docs.orchardcore.net/en/latest/reference/modules/Data/#sqlite" />.
/// </summary>
public class SqliteOptions
{
/// <summary>
/// <para>By default in .Net 6, <c>Microsoft.Data.Sqlite</c> pools connections to the database.
/// <para>By default in .Net 6, <c>Microsoft.Data.Sqlite</c> pools connections to the database.
/// It achieves this by putting a lock on the database file and leaving connections open to be reused.
/// If the lock is preventing tasks like backups, this functionality can be disabled.</para>
///
///
/// <para>There may be a performance penalty associated with disabling connection pooling.</para>
/// <see href="https://docs.microsoft.com/en-us/dotnet/standard/data/sqlite/connection-strings#pooling" />.
/// </summary>
Expand Down
25 changes: 0 additions & 25 deletions src/docs/community/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions src/docs/community/contributors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key))!

!!! info
Do you want to become an Orchard Core contributor too? Awesome! Check out [our contribution guide](../../guides/contributing/README.md).
Do you want to become an Orchard Core contributor too? Awesome! Check out [our contribution guide](../../contributing/README.md).

!!! tip
You can add new contributors by [using the All Contributors bot](https://allcontributors.org/docs/en/bot/usage).
Expand Down Expand Up @@ -498,4 +498,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ First of all, thank you for thinking about contributing to the code! Be sure to

## Working with Orchard Core's source code

First, clone the repository using the command `git clone https://github.com/OrchardCMS/OrchardCore.git` and checkout the `main` branch. Then, you have multiple options, see below. You can also use [any other .NET IDE](../../resources/development-tools/README.md) too.
First, clone the repository using the command `git clone https://github.com/OrchardCMS/OrchardCore.git` and checkout the `main` branch. Then, you have multiple options, see below. You can also use [any other .NET IDE](../getting-started/development-tools.md) too.

### Command Line

Expand Down Expand Up @@ -44,7 +44,7 @@ You might also read these two blog posts on contributing code: [Open Source Cont

- Familiarize yourself with the project and our coding conventions, as you can see in the repository. We follow the [ASP.NET Core Engineering guidelines](https://github.com/dotnet/aspnetcore/wiki/Engineering-guidelines).
- Make sure the repository can be built and all tests pass. This is also checked by the CI workflows.
- If you change CSS or JavaScript files, be sure to run [the Gulp pipeline](../../guides/gulp-pipeline/README.md).
- If you change CSS or JavaScript files, be sure to run [the Gulp pipeline](../guides/gulp-pipeline/README.md).
- If you want to start a conversation with other community members or run the CI workflows but you're not done yet, open your PR as a [draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests). Then, [change it to ready for review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request).
- If your PR addresses an issue, be sure to [link them](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) (e.g. with `Fixes #IssueId`). This helps everyone find their way around contributions, and merging your PR will automatically close the issue too.
- If there's no issue for your PR, then please describe the context and rationale in the pull request description, and provide screenshots/screen recordings of the changes if they affect the UX.
Expand All @@ -71,4 +71,4 @@ All code submissions will be reviewed and tested by the core team, and only thos
- [CodeRabbit](https://coderabbit.ai/) is available for AI on-demand code reviews, which they graciously provide for us as an open-source project for free. You can ask the bot for a code review with a `@coderabbitai review` comment under any pull request. You can have a conversation with it under its comments too. Note that AI code reviews can help, but are frequently incorrect; use your best judgment.

!!! tip
Do you want to demo what you've done to others, to showcase your work and to gather feedback? Join one of [our meetings](../../resources/meeting/README.md).
Do you want to demo what you've done to others, to showcase your work and to gather feedback? Join one of [our meetings](meetings.md).
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If you find a bug in Orchard Core, or have an idea for a new or improved feature

## What happens after you open an issue

We triage issues every week on [the triage meeting](../../resources/meeting/README.md), as well as core contributors may comment on your issue before that. Please reply to any inquiries.
We triage issues every week on [the triage meeting](meetings.md), as well as core contributors may comment on your issue before that. Please reply to any inquiries.

Once your issue is triaged, one of the following things will happen:

Expand All @@ -23,7 +23,7 @@ Once your issue is triaged, one of the following things will happen:
This is what [issue milestones](https://github.com/OrchardCMS/OrchardCore/milestones) mean:

- The next patch version (e.g. if the current version is `1.2.3`, then `1.2.4`) indicates the highest priority for serious regressions and other urgent bug fixes that we intend to fix ASAP and publish in a patch release.
- The next minor version (e.g. `1.3` if the current version is `1.2.0`) is for less urgent bug fixes and feature requests that we still think should be addressed in the next planned release. Regressions since the last release found by those from the community who live on the edge and use the [preview releases](../../getting-started/preview-package-source.md) are marked as such too.
- The next minor version (e.g. `1.3` if the current version is `1.2.0`) is for less urgent bug fixes and feature requests that we still think should be addressed in the next planned release. Regressions since the last release found by those from the community who live on the edge and use the [preview releases](../getting-started/preview-package-source.md) are marked as such too.
- Some later minor version (literally `1.x` if the current version is `1.anything`) is for issues that we intend to address eventually, maybe.
- The `backlog` milestone is for everything else that we think is a valid request, but we won't work on it any time soon.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Meeting
# Developer Meetings

Every week, we organize 2 meetings on <http://orchardcore.net/meeting>.
You can join by using the online webclient or install Microsoft Teams.
Expand Down
2 changes: 1 addition & 1 deletion src/docs/getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In this article, we are going to see how easy it is to create a CMS Web applicat
!!! note
This guide follows a manual process so you can have a deeper understanding of what's happening. You can also use our [code generation templates](templates/README.md) for a quicker start if you create a brand-new application. Check out [this guide](../guides/create-cms-application/README.md).

In Visual Studio (or [any other .NET IDE](../resources/development-tools/README.md)), create a new empty .NET web application, e.g. `Cms.Web`. Do not check "Place solution and project in the same directory", because later when you create modules and themes you will want them to live alongside the web application within the solution.
In Visual Studio (or [any other .NET IDE](../getting-started/development-tools.md)), create a new empty .NET web application, e.g. `Cms.Web`. Do not check "Place solution and project in the same directory", because later when you create modules and themes you will want them to live alongside the web application within the solution.

!!! note
If you want to use the `preview` packages, [configure the OrchardCore Preview url in your Package sources](preview-package-source.md).
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/docs/getting-started/test-drive-orchard-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Docker images and parameters can be found at <https://hub.docker.com/u/orchardpr

## The full source code

Of course, you can also clone and run the full source code of Orchard Core. See [the contribution docs](../guides/contributing/contributing-code.md) for this.
Of course, you can also clone and run the full source code of Orchard Core. See [the contribution docs](../contributing/contributing-code.md) for this.
Loading

0 comments on commit ba6ac27

Please sign in to comment.