|
| 1 | +import { PermissionMetadata, ResourceMetadata, RoleMetadata } from 'types'; |
| 2 | + |
| 3 | +// Note: this information will eventually come from the backend API |
| 4 | +// but for the MVP we decided to manage it in the frontend |
| 5 | +export const libraryRolesMetadata: RoleMetadata[] = [ |
| 6 | + { key: 'library_admin', name: 'Library Admin', description: 'The Library Admin has full control over the library, including managing users, modifying content, and handling publishing workflows. They ensure content is properly maintained and accessible as needed.' }, |
| 7 | + { key: 'library_author', name: 'Library Author', description: 'The Library Author is responsible for creating, editing, and publishing content within a library. They can manage tags and collections but cannot delete libraries or manage users.' }, |
| 8 | + { key: 'library_collaborator', name: 'Library Collaborator', description: 'The Library Collaborator can create and edit content within a library but cannot publish it. They support the authoring process while leaving final publishing to Authors or Admins.' }, |
| 9 | + { key: 'library_user', name: 'Library User', description: 'The Library User can view and reuse content but cannot edit or delete any resource.' }, |
| 10 | +]; |
| 11 | + |
| 12 | +export const libraryResourceTypes: ResourceMetadata[] = [ |
| 13 | + { key: 'library', label: 'Library', description: 'Permissions related to the library as a whole.' }, |
| 14 | + { key: 'library_content', label: 'Content', description: 'Permissions to create, edit, delete, and publish individual content items within the library.' }, |
| 15 | + { key: 'library_collection', label: 'Collection', description: 'Permissions to create, edit, and delete content collections within the library.' }, |
| 16 | + { key: 'library_team', label: 'Team', description: 'Permissions to manage user access and roles within the library.' }, |
| 17 | +]; |
| 18 | + |
| 19 | +export const libraryPermissions: PermissionMetadata[] = [ |
| 20 | + { key: 'create_library', resource: 'library', description: 'Allows the user to create new libraries.' }, |
| 21 | + { key: 'edit_library', resource: 'library', description: 'Allows the user to modify library settings and metadata.' }, |
| 22 | + { key: 'delete_library', resource: 'library', description: 'Allows the user to delete the library and all its contents.' }, |
| 23 | + { key: 'publish_library', resource: 'library', description: 'Publish the library (change from draft mode to published).' }, |
| 24 | + { key: 'view_library', resource: 'library', description: 'View content, search, filter, and sort within the library.' }, |
| 25 | + { |
| 26 | + key: 'manage_library_tags', resource: 'library', description: 'Add or remove tags from content.', |
| 27 | + }, |
| 28 | + |
| 29 | + { key: 'create_library_content', resource: 'library_content', description: 'Create new components or content units.' }, |
| 30 | + { key: 'edit_library_content', resource: 'library_content', description: 'Edit content in draft mode' }, |
| 31 | + { key: 'delete_library_content', resource: 'library_content', description: 'Delete individual content (not collections).' }, |
| 32 | + { key: 'publish_library_content', resource: 'library_content', description: 'Publish content, making it available for reuse' }, |
| 33 | + { key: 'reuse_library_content', resource: 'library_content', description: 'Reuse published content within a course.' }, |
| 34 | + |
| 35 | + { key: 'create_library_collection', resource: 'library_collection', description: 'Create new collections within a library.' }, |
| 36 | + { key: 'edit_library_collection', resource: 'library_collection', description: 'Add or remove content from existing collections.' }, |
| 37 | + { key: 'delete_library_collection', resource: 'library_collection', description: 'Delete entire collections from the library.' }, |
| 38 | + |
| 39 | + { key: 'manage_library_team', resource: 'library_team', description: 'View the list of users who have access to the library.' }, |
| 40 | + { key: 'view_library_team', resource: 'library_team', description: 'Add, remove, and assign roles to users within the library.' }, |
| 41 | +]; |
0 commit comments