angularjs - How give authentication for functions inside a component? -


inside component there 3 functions delete update , add. want give access these 3 functions different users. of 3 super user. 2 of them 1 that

i assume currentuser maintained session object. so,

delete(){    if(currentuser.role === admin) {       ....    } else {             //error message    } } 

Comments