c# - Have a webpart hide its self, if the user doesn't have proper permission -


If the user creates a web part page in SharePoint and then adds a custom web parts to me, For example, I have a reporting web part, in which some users have access to the reports and do nothing, I have some users Not even aware that the report exists They are.

I is a custom security API that uses to determine whether security is allowed or rejected, I would love to say:

  Secure Override Zero OnInit (EventArgs E) {bool permission = Permission services ISD ("report"); If (! Allowed) {this.Hide (); // where 'this' is the web part) base.OnInit (e); }  

I do not control the page code, so it should be in the Web part.

You want to see.

Actually, viewer targeting allows you to customize a page based on that person's group, so that a manager can go for "Home.aspx" and see the result of a top-sheet. Those who include some figures, but if a regular developer logs on to the same page, then the webpart will not be visible.

You should be careful that misleading audience targeting does not change the permissions of the users in it

Edit

Thanks to the cancerous cancer only works in Moss and not WSS.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -