dsv-su / play

Dev repository for Play
0 stars 1 forks source link

Refactor Visibility class! #76

Closed orkit closed 2 years ago

orkit commented 2 years ago

The VisibilityClass is a wrapper for a collection to cast visibility-attributes depending on settings at runtime. This class would need to be refactored.

The idea was that there would be only one class that handled all possible conditions for when a presentation would be visible. As new functions have been added, it has now become large and cluttered and would need to be rebuilt. However, the basic idea would be good to preserve - to only have one wrapper to filter a collection.

orkit commented 2 years ago

The class has now been refactored. Coursesettings overide the presentation setting. For presentations that belong to more courses will be hidden if there are different course settings and the same with the download (it causes more consequential problems that we need to fix*)

The following attributes can be used in blade components:

-hidden - for hidden presentations (users with viewing permissions) -edit - for editable presentations -download - for downloadable presentations -permission_type : 'dsv' - DSV students and staff, 'dsv_staff' . DSV staff, 'public' - Public, 'custom' - Custom course, 'test' - Reserved for test

The Visibility class can now be injected in any controller.