Skip to content

Add LMS app template for fine-grained authorization#132

Open
Tabintel wants to merge 36 commits intopermitio:mainfrom
Tabintel:add-lms-app-template
Open

Add LMS app template for fine-grained authorization#132
Tabintel wants to merge 36 commits intopermitio:mainfrom
Tabintel:add-lms-app-template

Conversation

@Tabintel
Copy link

Pull Request

Description

Adds a new Terraform template lms-app for a Learning Management System (LMS) with resources (course, enrollment, assignment), roles (student, teacher, teaching_assistant, admin), attributes, relationships, and fine-grained policies (e.g., students can read enrolled courses). Includes a README.md with usage instructions. The template is designed to work with a Go-based LMS using Appwrite for authentication and data storage, as described in the accompanying article.

Type of Change

  • Bug fix
  • New feature/command
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition/update
  • Other (please describe):

Checklist

  • I have created an issue and linked it in this PR
  • I have created a branch (add-lms-app-template) from main with an appropriate name (e.g., fix/issue-123, feature/new-command)
  • My code follows the project's coding style guidelines
  • I have added tests for my changes (>90% coverage of new code)
  • I have updated the documentation if necessary
  • All tests pass locally
  • Lint checks pass locally
  • I have reviewed my own code for potential issues

New Command Details (if applicable)

  • Command is placed in the src/commands directory
  • Command file contains only argument configuration and a root command component
  • Command is wrapped with the AuthProvider component
  • Command has an optional apiKey argument
  • API key scope is declared for the command
  • Documentation added to the README

Additional Notes

The lmsapp.tf file was initially ignored by .gitignore (likely due to a *.tf rule). I used git add -f to include it, as Terraform templates are expected in source/templates/ (example: blogging-platform.tf). Please advise if there is a preferred approach.

Screenshots/Recordings

Here is a screenshot of the lmsapp folder added to the source/templates directory

image

Copy link
Collaborator

@gemanor gemanor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the comments and attach screenshot of environment where you imported the policy

@@ -0,0 +1,189 @@
terraform {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move it to the source/template folder, and add the template description to the root readme file
Also, revert the .gitignore

required_providers {
permitio = {
source = "permitio/permit-io"
version = "~> 0.0.12"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be same as other templates

@gemanor
Copy link
Collaborator

gemanor commented Nov 3, 2025

Hey @Tabintel - can you address the comments and solve the failing build?

@Tabintel
Copy link
Author

Please address the comments and attach screenshot of environment where you imported the policy

Hi @gemanor, I have addressed the comments. Here is the screenshot
lmsapp

Tabintel and others added 24 commits November 14, 2025 13:29
Signed-off-by: orweis <orweis@gmail.com>
* Adding support for EU region

* Tests added

* Fix OAuth Login Bug, API Key Validation Bug, Terraform Export Bug, Infinite Loop Bug with policy create simple, Missing Actions Bug

* Default roles added for exporter
…lated components (permitio#139)

* Add createColumnResources option to Trino configuration and update related components

- Introduced `createColumnResources` boolean option in Trino options, defaulting to false.
- Updated `mapTrinoSchemaToPermitResources` to conditionally create column resources based on the new option.
- Modified `TrinoComponent` to pass `createColumnResources` prop.
- Enhanced `PDPRunComponent` to accept a `tag` prop for specifying the PDP image tag.
- Adjusted Docker command in `PDPRunComponent` to use the provided tag.
- Updated Trino resource naming for better clarity in the mapping function.
- Reduced healthcheck interval in Docker Compose for faster feedback during tests.

* Fix lint

* Refactor Trino resource mapping tests for improved clarity and consistency

- Updated resource keys in tests to use underscores instead of hyphens for consistency.
- Enhanced test assertions to include resource type prefixes (e.g., 'Catalog:', 'Schema:', 'Table:') for better readability.
- Added `createColumnResources` option in the `mapTrinoSchemaToPermitResources` function call to align with recent changes.

* Fix lint
@Tabintel Tabintel force-pushed the add-lms-app-template branch from 26ce195 to 24384dc Compare December 5, 2025 14:20
@Tabintel Tabintel requested a review from gemanor December 8, 2025 07:00
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.

8 participants