Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Know Admin from HMUsers array

I have an issue that When I want to add the room to the Home incase if the user is Guest then I am getting HMErrorCodeInsufficientPrivileges error. I have a view which will display after click on the button named "Add Room", My intensin is I want to detect it when the user clicked on the Add Room button and wants to display the alert without redirecting the user to Add Room View. Thank you for the valuable time. Please let me know if I am not clear.

like image 968
SRI Avatar asked Oct 31 '22 20:10

SRI


1 Answers

Finally in iOS 9 I found this solution.

 HMUser *adminOrNot = [selectedHome currentUser];
 HMHomeAccessControl *homeContr = [selectedHome homeAccessControlForUser:adminOrNot];

 if(homeContr.administrator)
 {

 }
like image 117
SRI Avatar answered Dec 24 '22 06:12

SRI