Skip to content

Use SchemaName instead of LogicalName for privilege#18

Merged
mkholt merged 7 commits into
mainfrom
execute-privilege-name-helper-bf0
Jul 1, 2026
Merged

Use SchemaName instead of LogicalName for privilege#18
mkholt merged 7 commits into
mainfrom
execute-privilege-name-helper-bf0

Conversation

@mkholt

@mkholt mkholt commented Jul 1, 2026

Copy link
Copy Markdown
Member

The privileges are named by schema-name, not entity logical name.
The fix is to use the type-name, which XrmContext sets to the schemaname of the entity.

mkholt and others added 7 commits June 30, 2026 15:51
Introduce a Privilege enum (Create/Read/Write/Delete/Append/AppendTo/
Assign/Share) in the Abstractions package and WithExecutePrivilege<T>
overloads on CustomApiConfigBuilder, resolving the platform privilege
name from the entity logical name (e.g. prvReadaccount). The existing
WithExecutePrivilegeName(string) remains for non-standard names.

Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
Introduce a Privilege enum (Create/Read/Write/Delete/Append/AppendTo/
Assign/Share) and WithExecutePrivilege<T> overloads on
CustomApiConfigBuilder, resolving the platform privilege name from the
entity logical name (e.g. prvReadaccount). The existing
WithExecutePrivilegeName(string) remains for non-standard names.

The enum lives in the main package rather than Abstractions: it is
input-side sugar consumed only at build time and resolved to the
ExecutePrivilegeName string, so consumers like XrmSync/XrmMockup never
need it.

Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
…m/delegateas/XrmPluginCore into execute-privilege-name-helper-bf0

# Conflicts:
#	XrmPluginCore/CHANGELOG.md
The Privilege enum covers more than CRUD (Append/AppendTo/Assign/Share),
so describe the parameter as a "table privilege" rather than a "CRUD
privilege" per review feedback.

Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
Dataverse table privilege names use the entity schema name (e.g.
prvReadAccount), not the logical name (account) which is the lowercased
schema name and thus loses the original casing. Take the schema name
from the early-bound type name (typeof(T).Name), which generators
produce from the schema name, so WithExecutePrivilege<Account>(Read)
now resolves to prvReadAccount. The string overload takes the schema
name directly.

Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
@mkholt mkholt merged commit 3cf0580 into main Jul 1, 2026
1 check passed
@mkholt mkholt deleted the execute-privilege-name-helper-bf0 branch July 1, 2026 06:50
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.

1 participant