有1个域分别有一个子域- school.com和students.school.com。
我已经使用谷歌应用程序脚本为每个班级创建了谷歌教室。
现在问题来了,
我正在尝试将教师和学生添加到google课堂。
我使用的‘超级管理员’帐户是我的主域(school.com)。
因此,我可以将教师添加到教室中,但不能将学生添加到教室中,因为它属于子域(students.school.com)
下面是我的代码的样子,
function addTeachers() {
Classroom.Courses.Teachers.create({
userId: "teacher1@school.com",
}, "123456789");
}
function addStudents() {
Classroom.Courses.Students.create({
userId: "student@students.school.com",
}, "123456789");
}当我运行addStudents函数时,出现以下错误:
Execution failed: The caller does not have permission发布于 2016-12-27 18:31:49
您需要确保域具有whitelisted each other,并允许来自其他域的用户添加到课程中。
发布于 2017-02-07 22:23:48
对于谷歌课堂来说,班级/老师在一个领域,而学生在另一个领域。在学生域中设置服务帐户。然后,使用所需的作用域将域范围的授权委派给服务帐户,这应该是
auth/classroom.rosters
auth/classroom.profile.emails
auth/classroom.profile.photos
并使用该服务帐户代表学生的google帐户执行courses.students.create方法(也就是同时使用courseid和enrollmentCode)。
https://stackoverflow.com/questions/41338949
复制相似问题