谁知道如何检查用户应用程序管理员权限的入口?解析文档中只提到iOS如何创建PFRole:
PFRole *role = [PFRole roleWithName:@"Administrator" acl:roleACL];
[role saveInBackground];发布于 2015-04-29 05:14:57
您可以查询指定给特定用户的角色。你可以这样做。
PFQuery query = [PFRole query];
[query whereKey:@"users" equalTo:user];
[query findObjectsInBackgroundWithBlock:(NSArray *objects, NSError *error) {
// get list of roles the user has been assigned for and check if that user has been assigned administrator
}];发布于 2015-04-29 05:36:46
你真的查过iOS文件了吗,你的答案已经给出了:-
仍需澄清:
您必须使用PFRole,它是PFObject的子类,除了一些特定于角色管理的特性之外,PFObject具有所有相同的特性。
这里是查找为单个解析DB.指定的所有用户角色的代码。
PFQuery query = [PFRole query];
[query whereKey:@"users" equalTo:user];
[query findObjectsInBackgroundWithBlock:(NSArrayobjects, NSError *error) {
// objects are the roles the user is assigned to
}];https://stackoverflow.com/questions/29931173
复制相似问题