Add permission management system with usergroups and ACL support#1
Open
Add permission management system with usergroups and ACL support#1
Conversation
- Add PermissionManager with full usergroup CRUD, group membership management, record/table permission get/set, and shareWithGroup() high-level method that handles both table and record level permissions - Add Permission utilities: fluent builder, parser, checker, presets, and describe() for human-readable permission debugging - Add TypeScript enums/interfaces: PermissionOp, PermissionSubject, ParsedPermission, SubjectPermissions, Usergroup, GroupMember - Register user-usergroup junction table model in WorldManager.loadModels() - Wire PermissionManager into DaptinClient and re-export all types - Enable skipLibCheck in tsconfig for clean builds https://claude.ai/code/session_01VyBcD34waoxJwBVBtLTHkn
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.
Summary
This PR introduces a comprehensive permission management system to the Daptin client library, enabling fine-grained access control through bit-flag permissions, usergroup management, and record/table-level ACLs.
Key Changes
New Permission System (
lib/clients/permission.ts)build(): Fluent permission buildercombine(): Compose permissions from three subject bitmasksparse(): Convert integer to human-readable ParsedPermission objectcan(): Check if a permission grants a specific operationdescribe(): Generate human-readable permission descriptionsPresets: Common permission configurations (NONE, OWNER_FULL, PUBLIC_READ, DEFAULT, UNIVERSAL, OWNER_FULL_GROUP_READ)New Permission Manager (
lib/clients/permissionmanager.ts)shareWithGroup()method that handles both table-level and record-level permissions to prevent the "403 even though I set permission" footgunInterface Updates (
lib/clients/interface.ts)Usergroupinterface for usergroup dataGroupMemberinterface for relationship dataSubjectPermissionsinterface for parsed single-subject permissionsParsedPermissioninterface for complete parsed permission objectsIntegration Updates
user_account_user_account_id_has_usergroup_usergroup_id) for JSON APIskipLibCheck: trueto improve build performanceNotable Implementation Details
shareWithGroup()automatically ensures table-level permissions before setting record permissions, preventing common authorization issueshttps://claude.ai/code/session_01VyBcD34waoxJwBVBtLTHkn