def revokeacl_course_share(usercoursebinding): try: dir_coursepublic = Dirname.coursepublic(usercoursebinding.course) dir_courseprivate = Dirname.courseprivate(usercoursebinding.course) if usercoursebinding.is_teacher: _revokeaccess(usercoursebinding.user, dir_courseprivate) _revokeaccess(usercoursebinding.user, dir_coursepublic) except Exception as e: logger.error("Cannot revoke acl %s -- %s" % (usercoursebinding, e))
def mkdir_course_share(course): try: dir_courseprivate = Dirname.courseprivate(course) _mkdir(dir_courseprivate, gid = course.groupid, mode = 0o770) dir_coursepublic = Dirname.coursepublic(course) _mkdir(dir_coursepublic, gid = course.groupid, mode = 0o750) logger.info("Course dir created for course %s" % course) except KeyError as e: logger.error("Cannot create course dir, KOOPLEX['mountpoint']['course'] is missing")
def grantacl_course_share(usercoursebinding): try: dir_coursepublic = Dirname.coursepublic(usercoursebinding.course) dir_courseprivate = Dirname.courseprivate(usercoursebinding.course) if usercoursebinding.is_teacher: _grantaccess(usercoursebinding.user, dir_coursepublic) _grantaccess(usercoursebinding.user, dir_courseprivate) else: _grantaccess(usercoursebinding.user, dir_coursepublic, acl = 'rX') except Exception as e: logger.error("Cannot grant acl %s -- %s" % (usercoursebinding, e))
def grantacl_course_share(usercoursebinding): try: dir_coursepublic = Dirname.coursepublic(usercoursebinding.course) dir_courseprivate = Dirname.courseprivate(usercoursebinding.course) if usercoursebinding.is_teacher: _grantaccess(usercoursebinding.user, dir_coursepublic) _grantaccess(usercoursebinding.user, dir_courseprivate) else: _grantaccess(usercoursebinding.user, dir_coursepublic, acl='rX') except Exception as e: logger.error("Cannot grant acl %s -- %s" % (usercoursebinding, e))
def mkdir_course_share(course): try: dir_courseprivate = Dirname.courseprivate(course) _mkdir(dir_courseprivate, gid=course.groupid, mode=0o770) dir_coursepublic = Dirname.coursepublic(course) _mkdir(dir_coursepublic, gid=course.groupid, mode=0o750) logger.info("Course dir created for course %s" % course) except KeyError as e: logger.error( "Cannot create course dir, KOOPLEX['mountpoint']['course'] is missing" )