Know administrator from HMUsers array

I have a problem: when I want to add a room to Home incase, if the user is a guest, then I get an HMErrorCodeInsufficientPrivileges error. I have a view that will be displayed after clicking the Add Room button, My Intensive is what I want to detect when the user clicks the Add Room button and wants to display a warning without redirecting the user to the Add Room View . Thanks for the valuable time. Please let me know if I do not know.

+5
source share
1 answer

Finally, in iOS 9, I found this solution.

  HMUser *adminOrNot = [selectedHome currentUser]; HMHomeAccessControl *homeContr = [selectedHome homeAccessControlForUser:adminOrNot]; if(homeContr.administrator) { } 
+2
source

All Articles