MSDN > 論壇首頁 > SharePoint - Development and Programming > Custom Application Page Inherit from team site instead of main top level site
發問發問
 

已答覆Custom Application Page Inherit from team site instead of main top level site

  • 2009年1月5日 下午 10:23Patrick001 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I'm new to SharePoint development so bear with me.

    What I'm doing is creating an application page in wss 3.0. by means of this article http://msdn.microsoft.com/en-us/library/bb418732.aspx now it works fine and I get it inheriting the from the master page and so on. The problem is that I don't want it inheriting from the top level sharepoint site I actually want it to inherit from a teamsite that I've created and use it's color scheme, quicklaunch, navigation menu and see that teamsites document libraries and calendars on the menus. Is there a way to do this?

    Next how do you have it inherit or set permisions? I would like my application page to have the same user permissions as the team site, so that only certain users can see and use it. Instead of it being accesable to anyone with the url.

    Any help would be much appreciated.

    Sincerely,
    Patrick

解答

所有回覆

  • 2009年1月6日 上午 05:07Sundar Narasiman MVPMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
     I don't think applications pages get hard-wired to any particular top-level site or a low-level site. Basically they live in _LAYOUTS directory. You can reference them in whichever site you want to execute (top-level site or low-level site). To answer your another question, definitely applicatin pages can be secured. It can directly apply the security permissions followed by your team site.

    You need to write your custom logic in appropriate events like PreInit, OnLoad to programmatically enumerate the permissions of a particular against team site and control the access accordingly.

    Sundar Narasiman
  • 2009年1月6日 下午 11:47Patrick001 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    OK well that sounds promising, at least know i know it can be done.

    So do you know of or can you point me in the right direction for resources on how to secure a application page by giving it the permissions of a team site. I've googled around and haven't come up with anything concrete.

    It would be very much appreciated.

    Sincerely,
    Patrick

  • 2009年1月7日 上午 04:25Sundar Narasiman MVPMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
     There are two parts to it. First you need to programmatically figure out the list of permissions asscociated with the Team Site, that you are mentioning.  After figuring out the permission-levels,  you need to write the logic for authorizing the user to access the application in the OnLoad method of your application page.

    The following article checks the permission level of a user, on the OnLoad method.
    http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2008/10/15/secure-a-sharepoint-application-page.aspx
    This would give you some pointer on how and where to add your authorization logic to your application page
    Sundar Narasiman