I have an application in which have 45 types of different user and every user has a set of functionalities available. We use enums to identify every set of user and each functionality is hardcoded in the client side which makes it very difficult to change.
e.g : USER_KABO, USER HAEB, USER_IOQW ... //Method getFunctionality is hardcoded for every user. -(ArrayList)getFunctionality:(UserType)type{ switch(type): case : USER_KABO: al = new ArrayList(); al.add(new Functionality()); case : USER HAEB; .... }
I iterate through this array to check if a user has a functionality or not. Depnding upon login status I set usertype in my code.
I am looking for a more flexible approach which could make it easy to add functionality to any user and allow to add any user without modifying too much code.