CSEN_FacultySharingForStudent_TDTM
Course Connection trigger handler/TDTM for faculty sharing
Custom Permission | REDU - Admin |
Event | AfterInsert, AfterUpdate, BeforeDelete |
Object | Course Connection |
Related RIO Education Settings | Student CC Faculty Sharing Enabled |
Description
If the org sharing setting for the Course Connection object allows sharing (i.e. is anything other than Public Read/Write) and the 'Student CC Faculty Sharing Enabled' custom setting is enabled, then this class grants a Faculty member access to their student's Course Connection records.
Whenever a student Course Connection is updated, then this class will first remove any previously granted access to this Course Connection. It will then get any faculty Course Connections for the same Course Offering with a Status of Current and grant those Faculty users access. The AccessLevel and RowCause fields of the new sharing record are determined by the 'Student CC Faculty Sharing Access Level' and 'Student CC Faculty Sharing Reason' custom settings.
Whenever a new student Course Connection is inserted, then only the addition of new access will be performed. Whenever an existing student Course Connection's Course Offering ID field is set to null, then only the removal of old access will be performed.
Whenever a faculty Course Connection is updated, then this class will first remove any previously granted access to student Course Connections. It will then grant the related faculty User access to any student Course Connections related to this Course Offering. Once again, the AccessLevel and RowCause fields of the new sharing record are determined by the 'Student CC Faculty Sharing Access Level' and 'Student CC Faculty Sharing Reason' custom settings.
Whenever a new faculty Course Connection is inserted, then only the addition of new access will be performed.
Whenever a faculty Course Connection is deleted, this class ensures that any access previously granted to this faculty User is revoked first.