Skip to content

Implement complete identity model with default group, standard policies, and enhanced interfaces#13

Merged
ReneSchwarzer merged 2 commits intodevelopfrom
copilot/develop-identity-model
Apr 11, 2026
Merged

Implement complete identity model with default group, standard policies, and enhanced interfaces#13
ReneSchwarzer merged 2 commits intodevelopfrom
copilot/develop-identity-model

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

Implements the identity model per the WebExpress Development Guide: the authorization chain Identity → Group → Policy → Permission, a default "All" group, and the three standard policies.

Interface changes

  • IIdentityGroup: Added Id and Name properties (previously only had Policies)
  • IIdentityPolicyContext: Added Policy type property (symmetric with IIdentityPermissionContext.Permission)
  • IIdentityManager: Added AllGroup property

Default "All" group

Every identity implicitly belongs to IdentityGroupAll. CheckAccess(identity, permission) now unions the identity's explicit groups with AllGroup before evaluating the chain:

public bool CheckAccess(IApplicationContext applicationContext, IIdentity identity, Type permission)
{
    var groups = (identity?.Groups ?? []).Append(AllGroup);
    return groups.Any(group => CheckAccess(applicationContext, group, permission));
}

The "All" group ships with the PublicAccess policy pre-assigned.

Standard policies

Three sealed IIdentityPolicy implementations in WebIdentity/:

  • PublicAccess — access to public resources without authentication
  • AuthenticatedAccess — general access for authenticated users
  • SystemAccess — system-level operations (install, update, maintain)

All three carry [Name] and [Description] attributes pointing to i18n keys, with English and German translations added.

Tests

Four new tests covering AllGroup existence/properties, PublicAccess policy membership, and IIdentityGroup interface contract. Full suite passes (869/869).

Copilot AI and others added 2 commits April 11, 2026 14:18
…ault All group, standard policies, and tests

Agent-Logs-Url: https://github.com/webexpress-framework/WebExpress.WebCore/sessions/f69b558f-1a72-4801-809e-0fb3012f0dc9

Co-authored-by: ReneSchwarzer <31061438+ReneSchwarzer@users.noreply.github.com>
@ReneSchwarzer ReneSchwarzer merged commit 08d299f into develop Apr 11, 2026
1 check passed
@ReneSchwarzer ReneSchwarzer deleted the copilot/develop-identity-model branch April 11, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants