ASP.Net User Role Hierarchy -
i have in project user role hierarchy pages need more, imagine 2 roles can open adduser.aspx
page can see here packages packages sending companies , companies have number.
i when user of company opened page show packages him. difficult part writing code ..
code examples :
public string number { { return (string)cachemanagement.getcache( string.format("{0}{1}", "edistraintcache", currentsession.currentuser.userid), getnumber); } }
and have if statemnt in 15 pages
if (enum.getvalues(typeof(umroles)) .cast<umroles>() .any(umrole => currentuser.userroles.any(x => x.rolkey.contains(umrole.getstringvalue())))) { //... }
have suggest code or idea writing better code ?.
Comments
Post a Comment