创建Parse Role Hierarchy失败,'parent is undefined'
Creating a Parse Role Hierarchy fails with 'parent is undefined'
在Parse
中设置角色层次结构时出现奇怪的错误:
Uncaught ReferenceError: parent is not defined
角色都是在Parse中创建的,我从getRoles
中得到的关系对象看起来很好,但是当调用add
方法时,我得到了这个错误。还有人有类似的经历吗?
function createRolesForOrganization(organization){
var self = Parse.User.current();
var ownerRole = new Parse.Role(organization.id + '_Owner', new Parse.ACL(self)),
adminRole = new Parse.Role(organization.id + '_Admin', new Parse.ACL(self)),
userRole = new Parse.Role(organization.id + '_User', new Parse.ACL(self));
return Parse.Object
.saveAll([
ownerRole,
adminRole,
userRole
])
.then(function(objs){
ownerRole = objs[0];
adminRole = objs[1];
userRole = objs[2];
userRole.getRoles().add(adminRole);
adminRole.getRoles().add(ownerRole);
return Parse.Object.saveAll([
ownerRole,
adminRole,
userRole
]);
});
}
这是Parse JavaScript SDK中的一个bug,报告如下:https://developers.facebook.com/bugs/1677477152487599/
在此期间,一个快速的解决方案是将"parent"替换为"this"。相关文章:
- Jquery - table.row(tr) is undefined
- $routeParams is undefined
- Angular js $scope is Undefined
- Angular - $cookies is undefined
- TypeError: e is undefined - javascript
- “google.maps.MapTypeId is undefined”在FF 14中使用GMAP3时
- chrome.storage.local["mykey"] is undefined
- 回调在 Angular2/Firebase 中生成“TypeError: this is undefined”
- KendoWindow .visible(); is undefined?
- jquery: $ is undefined
- ReactDom is undefined
- TypeScript: TypeError b is undefined
- rowdata is undefined
- mozChannels/mozSampleRate is undefined
- phonegap build cordova.file is undefined
- window.jQuery.ui is undefined
- blackberry.io.dir.appDirs is undefined
- Youtube iFrame API 'YT is undefined'
- SignalR $.connection is undefined
- “window.angular is undefined.” 当使用量角器进行自动测试时