Use SchemaName instead of LogicalName for privilege#18
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.