用户可以在解析中创建另一个用户吗? [英] Can a user create another user in parse?

查看:40
本文介绍了用户可以在解析中创建另一个用户吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景

使用解析构建的应用程序,具有三种不同类型的用户

An application built using parse that has three different types of users

用户类型角色

用户类型 A - 从用户类型 B 和 C 创建新用户并为他们分配任务.用户类型 B - 登录并完成用户类型 A 分配的任务.用户类型 c - 监控用户类型 B 分配的任务.

user type A - create new users from user type B and C and allocate them tasks. User type B - log in and complete tasks allocated by user type A. User type c - Monitor tasks allocated by user type B.

用户 A 注册该应用程序,然后登录该应用程序.然后,他们可以从用户类型 B 和用户类型创建一组用户.C ,他们可以登录并完成用户类型 A 分配给他们的个人任务.

User A signs up to the application then signs in to the application. They then can create a group of users from both user type B & C , who can log in and complete individual tasks assigned to them by user type A.

我的问题是这可以通过 parse 实现吗?

My question is this possible with parse ?

推荐答案

如果我正确理解您的问题,您需要为 User 类设置类级别权限.确保允许创建客户端类"设置为是".从那里你可以做一些事情,比如创建一个名为 User A 或 B 的新类.

If I understand your question correctly, you need to set class level permission for the User class. Make sure "Allow client class creation" is set to YES. From there you can do things like create a new class called User A or B.

从当前用户创建一个新类将类似于:

Creating a new class from current user would be something like:

- (void)newUser {
PFUser *userB = [PFUser objectWithClassName:@"UserB"];
[userB setObject:(whatever you want to add to UserB) forKey:@""];
}

您甚至可以将您的新对象与添加它的用户相关联:

You can even relate your new object to the user who is adding it:

[userB setObject:[PFUser currentUser] forKey:@"creator"];

此处 currentUser 将是 UserA.

Here currentUser would be UserA.

这篇关于用户可以在解析中创建另一个用户吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆