Mutli-User Firebase Database - swift

I'm trying to create a sign up screen in Xcode that allows a user to pick a "account type" designer, singer etc. that then groups those individuals together and creates their account, grouping them by their account type.
I am able to create accounts and store them within my Firebase database and I have the drop box with all the account types but I don't understand or know how to create these account types and attach them as identifiers of each user upon sign up.

Related

How do I trigger a blocking function when a new user registers to check that their email address is in a collection?

I have a flutter app using firebase and google cloud. The organization providing the app to their users uploads a list of users that are able to register and create an account. When a user goes to register I want two things to happen:
They are given an error message if their email address and ID number do not match an existing document with email and ID field values
Existing fields, like their department and deck number that are in the collection uploaded by the organization are copied to their new user profile
I would write a cloud v2 function. The documentation has some great examples of how to block registration. What you would want to do is in the beforeUserCreated method, look up the field in firestore to validate that their email. You can get their email through the AuthBlockingEventType additionalUserInfo field which should provide the username (email in this case) to compare against the firestore database.
Deploying an AuthBlocking function is the same deployment as any other function.
Once deployed, you will need to remember to register your blocking function for it to take effect.
As far as updating their user profile information, you could just use another cloud function to listen for a database change once the user is registered and then copy that data over.

How is the user created in the default Users table of iCloud Dashboard?

I'm using the cloudkit, and I found in Apple's management platform, iCloud Dashboard, that PublicDatabse defaults to the "Users" table, and there was a record that should be my developer record.
I want to know how it was created because I now need to use the records under "Users".
If a new user opens my App, does it automatically create a "Users" record? Or do I need to manually create it myself?

Sitecore - Is there a way to clone/duplicate a user in the User Manager?

I have an account setup exactly the way I'd like a number of individuals accounts setup and I'd like to create them as clones of this account so the get the initial set of permissions without me having to manually set all the permission on each account.
Note: It is fine (ideal?) if once the accounts are created that they no longer have a relationship with the original account. For instance, if User A is the base account that is being used to create all the other accounts, once User B is made from User A then all further changes on User A will not be reflected on User B.
Any ideas?
In answer to your question: no, there is no clone/copy user feature in the User Editor in Sitecore.
It sounds like you would be better off creating a role with all these permissions, then assigning this role to any new users you create. You could then modify the permissions of the individual users as necessary.
Note this would not be the ideal solution as it's always better to apply security to roles rather than individual users.
Perhaps you could achieve what you need by creating a collection of roles and assigning different combinations of them to each user?
Try installing this Sitecore Module.This will clone the user in User Manager
SITECORE USER CLONE
Sitecore User Clone is used to create the copy of the user with the same roles, name, email, and profile. It will prompt to accept the new username, password and all the editable fields same like Edit user.

ManagedObjectModel for my app

I read some articles and info in developer.apple.com about Core Data. Now I want to create ManagedObjectModel for my app. So I need to help - because it's first my planning about database. So my app will have next options
User must login with his Login and Password. So if he forget password, there is chance to create new pass by entering correct answer on secret question.
App will store contacts. Every contact have name, surname, photo, phones, and coollection of map annotations.
User can create some groups (like Family, Friends...)
So this app I create for understanding basics of objective-c and maybe there are no logic in my app.
Please check my entities, maybe I allowed blunder.
First entity Contact
id - number of contact.
image - I will store array there. So if image <200 Kb I insert it in database, if more I will save the path to this image
map - the dictionary of map annotations
name
phones - array of phone numbers
surname
Second entity Group
contacts - array that contain id of contacts, that belong to this group
id - number of group
title - it is the name of group (like Family, Friends...)
Third entity Login
groups - array that contain id of groups, that belong to this group
login
password
secret answer - answer to the secret question
secret question
Relationships
So each Login can have some groups, but each group will belong only to one Login. So I create "to-many relationship" for group relationship. So each group contain some contacts and contacts can be in some different gruops - I create many-to-many relationship.
About property "optional". I understand that if it's not check - this attribute or relationship have to be. So I remove this property for
"id" in Contact
"id" in Group
"login", "password" in Login
in relationship "toGroups" in Contact
in relationship "toLogin" in Group
About "Delete Rule". I want if I delete some Login all groups and contacts belong to this login must be delete. I can choose "Cascade" for relationship "group" in Login but it will delete only groups but not contacts. I cann't do such for relationship "toContact" because if I delete some Group it will delete contacts, but other Groups still can have this contacts. So maybe I must create attribute "contact" in Login that will be array of contacts, and create relationship to Contacts and if I delete Login all groups and contacts that belong to it, will be delete.
PS Sorry I am stil newbie and my question maybe funny for you, but I need help
A few things I noticed -
You have no need to use 'id' properties. Most databases plan on these for primary/foreign key management, but core data will manage this all for you provided you have the relationships set up. Also by this logic, you don't need properties to manually create that relationship (i.e. 'Contacts' in group and 'groups' in login
Are you sure you wants to be storing dictionaries and/or arrays in an entity? These sound like another standalone entity such as one for map annotations. Then you would build a one-to-many relationship from the original object to the new one.
Images stored as binary data are not the most efficient way to go about this. Its better to use the filesystem the app sandbox provides. Just saw a similar question the other day Storing images locally on an iOS device

Managing Users in iTunes Connect

I've created an iOS Developer individual account because I want to upload an application that I've got developed from another developer. I want to allow the other developer to upload the application to my profile.
Can I manage users and add him as an admin to my iTune Connect? Is this facility available only for company accounts?
I saw this which says "You are the only one allowed access to Program resources." under individual registration.
http://developer.apple.com/enroll/selectEnrollmentType.php?t=nm
Only company accounts can allow multiple users.
Edited: This is based on experience. If you register as a company you can add additional accounts (via the Member Center). If you sign up as a user, you can only have a single account for logging into iTunes Connect.
This is what it means by "You can add additional developers to your team who can access Program resources." under the Company column on that select enrollment type page.
You can also add team members in an individual license. I am enrolled in the iOS and Mac OS program and have added two of my friends to work together with me on an app. The UI shows that this is the way it should be (in the upper right corner is written "Florian Pilz, Florian Pilz", whereby the first name is the name of the team agent [me] and the second name is the name of the user currently logged in [me in my case, another in the case of my friends]).