Skip to content

Commit f686113

Browse files
authored
fix: restore icons in permissions after consolidation (#159)
1 parent 062574c commit f686113

2 files changed

Lines changed: 84 additions & 18 deletions

File tree

src/authz-module/roles-permissions/course/constants.ts

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ import {
1010
Download,
1111
DrawShapes,
1212
CheckCircle,
13+
RemoveRedEye,
14+
Plus,
15+
EditOutline,
16+
DownloadDone,
17+
Settings,
18+
Checklist,
19+
Delete,
20+
Upload,
1321
Award,
1422
} from '@openedx/paragon/icons';
1523

@@ -103,193 +111,222 @@ export const coursePermissions: PermissionMetadata[] = [
103111
resource: 'course_access_content',
104112
description: 'View course in the course list, access the course outline in read only mode, includes the "View Live" entry point.',
105113
label: 'View course',
114+
icon: RemoveRedEye,
106115
},
107116
{
108117
key: CONTENT_COURSE_PERMISSIONS.CREATE_COURSE,
109118
resource: 'course_access_content',
110119
description: 'Create a new course in Studio.',
111120
label: 'Create course',
121+
icon: Plus,
112122
},
113123
{
114124
key: CONTENT_COURSE_PERMISSIONS.EDIT_COURSE_CONTENT,
115125
resource: 'course_access_content',
116126
description: 'Edit course content, outline, units, components.',
117127
label: 'Edit course content',
128+
icon: EditOutline,
118129
},
119130
{
120131
key: CONTENT_COURSE_PERMISSIONS.PUBLISH_COURSE_CONTENT,
121132
resource: 'course_access_content',
122133
description: 'Publish course content.',
123134
label: 'Publish course content',
135+
icon: DownloadDone,
124136
},
125137

126138
{
127139
key: CONTENT_COURSE_PERMISSIONS.REVIEW_COURSE_LIBRARY_UPDATES,
128140
resource: 'course_library_updates',
129141
description: 'Accept or reject library updates in Studio.',
130142
label: 'Review library updates',
143+
icon: Checklist,
131144
},
132145

133146
{
134147
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_UPDATES,
135148
resource: 'course_updates_handouts',
136149
description: 'View course updates and handouts.',
137150
label: 'View course updates',
151+
icon: RemoveRedEye,
138152
},
139153
{
140154
key: CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_UPDATES,
141155
resource: 'course_updates_handouts',
142156
description: 'Manage course updates and handouts, create, edit, delete.',
143157
label: 'Manage course updates',
158+
icon: Settings,
144159
},
145160

146161
{
147162
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_PAGES_RESOURCES,
148163
resource: 'course_pages_resources',
149164
description: 'View Pages and Resources.',
150165
label: 'View pages & resources',
166+
icon: RemoveRedEye,
151167
},
152168
{
153169
key: CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_PAGES_RESOURCES,
154170
resource: 'course_pages_resources',
155171
description: 'Edit Pages and Resources, including toggles and content managed from that section.',
156172
label: 'Manage pages & resources',
173+
icon: Settings,
157174
},
158175

159176
{
160177
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_FILES,
161178
resource: 'course_files',
162179
description: 'View the Files page.',
163180
label: 'View files',
181+
icon: RemoveRedEye,
164182
},
165183
{
166184
key: CONTENT_COURSE_PERMISSIONS.CREATE_COURSE_FILES,
167185
resource: 'course_files',
168186
description: 'Upload files.',
169187
label: 'Create files',
188+
icon: Plus,
170189
},
171190
{
172191
key: CONTENT_COURSE_PERMISSIONS.EDIT_COURSE_FILES,
173192
resource: 'course_files',
174193
description: 'Non destructive file actions, for example lock or unlock, exact actions depend on implementation.',
175194
label: 'Edit files',
195+
icon: EditOutline,
176196
},
177197
{
178198
key: CONTENT_COURSE_PERMISSIONS.DELETE_COURSE_FILES,
179199
resource: 'course_files',
180200
description: 'Delete files.',
181201
label: 'Delete files',
202+
icon: Delete,
182203
},
183204

184205
{
185206
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_SCHEDULE,
186207
resource: 'course_schedule_details',
187208
description: 'View course schedule.',
188209
label: 'View schedule',
210+
icon: RemoveRedEye,
189211
},
190212
{
191213
key: CONTENT_COURSE_PERMISSIONS.EDIT_COURSE_SCHEDULE,
192214
resource: 'course_schedule_details',
193215
description: 'Edit course schedule.',
194216
label: 'Edit schedule',
217+
icon: EditOutline,
195218
},
196219
{
197220
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_DETAILS,
198221
resource: 'course_schedule_details',
199222
description: 'View course details.',
200223
label: 'View course details',
224+
icon: RemoveRedEye,
201225
},
202226
{
203227
key: CONTENT_COURSE_PERMISSIONS.EDIT_COURSE_DETAILS,
204228
resource: 'course_schedule_details',
205229
description: 'Edit course details, includes Course Summary, Course Pacing, Course Details, Course Pre requisite.',
206230
label: 'Edit course details',
231+
icon: EditOutline,
207232
},
208233

209234
{
210235
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_GRADING_SETTINGS,
211236
resource: 'course_grading',
212237
description: 'View grading settings page.',
213238
label: 'View grading settings',
239+
icon: RemoveRedEye,
214240
},
215241
{
216242
key: CONTENT_COURSE_PERMISSIONS.EDIT_COURSE_GRADING_SETTINGS,
217243
resource: 'course_grading',
218244
description: 'Edit grading settings.',
219245
label: 'Edit grading settings',
246+
icon: EditOutline,
220247
},
221248

222249
{
223250
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_TEAM,
224251
resource: 'course_team_group',
225252
description: 'View the course team roster.',
226253
label: 'View course team',
254+
icon: RemoveRedEye,
227255
},
228256
{
229257
key: CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_TEAM,
230258
resource: 'course_team_group',
231259
description: 'Edit course team membership and roles.',
232260
label: 'Manage course team',
261+
icon: Settings,
233262
},
234263
{
235264
key: CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_GROUP_CONFIGURATION,
236265
resource: 'course_team_group',
237266
description: 'Manage content groups.',
238267
label: 'Manage group configuration',
268+
icon: Settings,
239269
},
240270

241271
{
242272
key: CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_TAGS,
243273
resource: 'course_tags_taxonomies',
244274
description: 'Create, edit, delete tags.',
245275
label: 'Manage tags',
276+
icon: Settings,
246277
},
247278

248279
{
249280
key: CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_ADVANCED_SETTINGS,
250281
resource: 'course_advanced_certificates',
251282
description: 'Access and edit Advanced Settings.',
252283
label: 'Manage advanced settings',
284+
icon: Settings,
253285
},
254286
{
255287
key: CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_CERTIFICATES,
256288
resource: 'course_advanced_certificates',
257289
description: 'Access and edit Certificates.',
258290
label: 'Manage certificates',
291+
icon: Settings,
259292
},
260293

261294
{
262295
key: CONTENT_COURSE_PERMISSIONS.IMPORT_COURSE,
263296
resource: 'course_import_export',
264297
description: 'Show Import in Studio, this is treated as a high privilege action and effectively implies most authoring permissions.',
265298
label: 'Import course',
299+
icon: Download,
266300
},
267301
{
268302
key: CONTENT_COURSE_PERMISSIONS.EXPORT_COURSE,
269303
resource: 'course_import_export',
270304
description: 'Show Export in Studio.',
271305
label: 'Export course',
306+
icon: Upload,
272307
},
273308
{
274309
key: CONTENT_COURSE_PERMISSIONS.EXPORT_COURSE_TAGS,
275310
resource: 'course_import_export',
276311
description: 'Export tags.',
277312
label: 'Export tags',
313+
icon: Upload,
278314
},
279315

280316
{
281317
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_CHECKLISTS,
282318
resource: 'course_other',
283319
description: 'View checklists.',
284320
label: 'View checklists',
321+
icon: RemoveRedEye,
285322
},
286323
{
287324
key: CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_GLOBAL_STAFF_SUPER_ADMINS,
288325
resource: 'course_other',
289326
description: 'Allow course or library admins to view the list of global Staff and Super Admin users.',
290327
label: 'View global staff & super admins',
328+
icon: RemoveRedEye,
291329
},
292-
293330
];
294331

295332
// roles hardcoded, todo: need to add the constants from above in order to merge the different permissions array.

src/authz-module/roles-permissions/library/constants.ts

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ import {
33
} from '@src/types';
44
import {
55
Group, CollectionsBookmark, Notes, AutoAwesomeMosaic,
6+
RemoveRedEye,
7+
Settings,
8+
DownloadDone,
9+
Plus,
10+
EditOutline,
11+
Delete,
12+
SpinnerIcon,
13+
FileDownload,
614
} from '@openedx/paragon/icons';
715

816
export const CONTENT_LIBRARY_PERMISSIONS = {
@@ -58,27 +66,48 @@ export const libraryResourceTypes: ResourceMetadata[] = [
5866
];
5967

6068
export const libraryPermissions: PermissionMetadata[] = [
61-
{ key: CONTENT_LIBRARY_PERMISSIONS.VIEW_LIBRARY, resource: 'library', description: 'View content, search, filter, and sort within the library.' },
6269
{
63-
key: CONTENT_LIBRARY_PERMISSIONS.MANAGE_LIBRARY_TAGS, resource: 'library', description: 'Add or remove tags from content.', label: 'Manage Tags',
70+
key: CONTENT_LIBRARY_PERMISSIONS.VIEW_LIBRARY, resource: 'library', label: 'View', description: 'See the library in Studio and access its content in read-only mode.', icon: RemoveRedEye,
6471
},
65-
{ key: CONTENT_LIBRARY_PERMISSIONS.PUBLISH_LIBRARY_CONTENT, resource: 'library', description: 'Allows the user to publish the library and all its contents.' },
66-
67-
{ key: CONTENT_LIBRARY_PERMISSIONS.CREATE_LIBRARY_CONTENT, resource: 'library_content', description: 'Create content within the library.' },
68-
{ key: CONTENT_LIBRARY_PERMISSIONS.EDIT_LIBRARY_CONTENT, resource: 'library_content', description: 'Edit content in draft mode' },
69-
{ key: CONTENT_LIBRARY_PERMISSIONS.DELETE_LIBRARY_CONTENT, resource: 'library_content', description: 'Delete content within the library.' },
70-
{ key: CONTENT_LIBRARY_PERMISSIONS.PUBLISH_LIBRARY_CONTENT, resource: 'library_content', description: 'Publish content, making it available for reuse' },
71-
{ key: CONTENT_LIBRARY_PERMISSIONS.REUSE_LIBRARY_CONTENT, resource: 'library_content', description: 'Reuse published content within a course.' },
7272
{
73-
key: CONTENT_LIBRARY_PERMISSIONS.IMPORT_LIBRARY_CONTENT, resource: 'library_content', description: 'Import content from courses.', label: 'Import Content from Course',
73+
key: CONTENT_LIBRARY_PERMISSIONS.MANAGE_LIBRARY_TAGS, resource: 'library', label: 'Manage tag', description: 'Create, edit, and delete tags on this library.', icon: Settings,
74+
},
75+
{
76+
key: CONTENT_LIBRARY_PERMISSIONS.DELETE_LIBRARY, resource: 'library', label: 'Publish', description: 'Publish the library to make it available for use in courses.', icon: DownloadDone,
77+
},
78+
{
79+
key: CONTENT_LIBRARY_PERMISSIONS.CREATE_LIBRARY_CONTENT, resource: 'library_content', label: 'Create', description: 'Create new content items in the library.', icon: Plus,
80+
},
81+
{
82+
key: CONTENT_LIBRARY_PERMISSIONS.EDIT_LIBRARY_CONTENT, resource: 'library_content', label: 'Edit', description: 'Edit existing content items in the library.', icon: EditOutline,
83+
},
84+
{
85+
key: CONTENT_LIBRARY_PERMISSIONS.DELETE_LIBRARY_CONTENT, resource: 'library_content', label: 'Delete', description: 'Permanently remove content items from the library.', icon: Delete,
86+
},
87+
{
88+
key: CONTENT_LIBRARY_PERMISSIONS.PUBLISH_LIBRARY_CONTENT, resource: 'library_content', label: 'Publish', description: 'Publish individual content items to make them available for reuse in courses.', icon: DownloadDone,
89+
},
90+
{
91+
key: CONTENT_LIBRARY_PERMISSIONS.REUSE_LIBRARY_CONTENT, resource: 'library_content', label: 'Reuse', description: 'Add published content from this library to a course.', icon: SpinnerIcon,
92+
},
93+
{
94+
key: CONTENT_LIBRARY_PERMISSIONS.IMPORT_LIBRARY_CONTENT, resource: 'library_content', label: 'Import Content from Course', description: ' Import content from an existing course into this library.', icon: FileDownload,
95+
},
96+
{
97+
key: CONTENT_LIBRARY_PERMISSIONS.VIEW_LIBRARY_TEAM, resource: 'library_team', label: 'View', description: 'See the list of users with a role assigned to this library.', icon: RemoveRedEye,
98+
},
99+
{
100+
key: CONTENT_LIBRARY_PERMISSIONS.MANAGE_LIBRARY_TEAM, resource: 'library_team', label: 'Manage', description: 'Add, change, or remove role assignments for this library from the Roles and Permissions console.', icon: Settings,
101+
},
102+
{
103+
key: CONTENT_LIBRARY_PERMISSIONS.CREATE_LIBRARY_COLLECTION, resource: 'library_collection', label: 'View', description: 'Create new collections to organize content within the library.', icon: RemoveRedEye,
104+
},
105+
{
106+
key: CONTENT_LIBRARY_PERMISSIONS.EDIT_LIBRARY_COLLECTION, resource: 'library_collection', label: 'Publish', description: 'Update the name and contents of existing collections.', icon: EditOutline,
107+
},
108+
{
109+
key: CONTENT_LIBRARY_PERMISSIONS.DELETE_LIBRARY_COLLECTION, resource: 'library_collection', label: 'Edit', description: 'Permanently remove collections from the library.', icon: EditOutline,
74110
},
75-
76-
{ key: CONTENT_LIBRARY_PERMISSIONS.VIEW_LIBRARY_TEAM, resource: 'library_team', description: 'View the list of users who have access to the library.' },
77-
{ key: CONTENT_LIBRARY_PERMISSIONS.MANAGE_LIBRARY_TEAM, resource: 'library_team', description: 'Add, remove, and assign roles to users within the library.' },
78-
79-
{ key: CONTENT_LIBRARY_PERMISSIONS.CREATE_LIBRARY_COLLECTION, resource: 'library_collection', description: 'Create new collections within a library.' },
80-
{ key: CONTENT_LIBRARY_PERMISSIONS.EDIT_LIBRARY_COLLECTION, resource: 'library_collection', description: 'Add or remove content from existing collections.' },
81-
{ key: CONTENT_LIBRARY_PERMISSIONS.DELETE_LIBRARY_COLLECTION, resource: 'library_collection', description: 'Delete entire collections from the library.' },
82111
];
83112

84113
export const rolesLibraryObject: Role[] = [

0 commit comments

Comments
 (0)