Can i use hasaccess object twice

jack_pete

New member
Joined
Oct 3, 2015
Messages
2
Programming Experience
3-5
I want to display / nodisplay title based on my user access.
I have below code where i determine my access (hasaccess)
                                                                bool hasAccess = false;
                                                                if (Session.UserRights != null)
                                                                {
                                                                   if(EngineClient.UserHasAccess(Session.UserRights, doc.AccessL1, doc.Denied1))
                                                                   {
                                                                      hasAccess= true;
                                                                   }
                                                                 }
                                                                 if (hasAccess == false)
                                                                     { Display Image }
                                                                  else { Display No Image }

Can i also use same access (hasaccess) to display title if have access and no title if i have no access.
This is what i have written not sure where i am making mistake.
if (hasAccess == true)
 { Display Preview }
  else 
{ <% return false %>
}
 
Last edited by a moderator:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,792
Location
Sydney, Australia
Programming Experience
10+
Hmmm... I moved this thread but now I'm not so sure it was the right thing to do. What type of application is this? Are those two code snippets from the same code file?
 
Top Bottom