Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 20 of 20

Thread: Setting admin rights

  1. #1
    Manley is offline Senior Member
    Join Date
    May 2009
    Posts
    118

    Default Setting admin rights

    Is there a way to setup and admin account which will only allow the admin to view orders? I have a few people who will be viewing orders as they come in but I don't want them to have any right above that. They have no need to make changes to anything so I would rather limit them as a just in case.

    Please let me know if this is possible.

    Thank you

  2. #2
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

  3. #3
    Manley is offline Senior Member
    Join Date
    May 2009
    Posts
    118

    Default re

    I Followed the directions that the link gave and change the file to newmenuData.xml after doing everything the link instructed this is the code I want the user to be allowed to use
    HTML Code:
    <SiteMap>
    	<!-- Home -->
    	<item Text="(!admin.menu.Home!)" NavigateUrl="splash.aspx" LookId="TopItemLook"/>
    	<!-- Orders Menu -->
    	<item Text="(!admin.menu.Orders!)" NavigateUrl="orders.aspx"  LookId="TopItemLook">
    		<item Text="(!admin.menu.OrderManage!)" NavigateUrl="orders.aspx" />
    		<item Text="(!admin.menu.PhoneOrder!)" NavigateUrl="phoneorder.aspx" />
    		<item Text="(!admin.menu.OrderRecurring!)" Look-RightIconUrl="arrow.gif" Look-RightIconWidth="15">
    			<item Text="(!admin.menu.OrderRecurringToday!)" NavigateUrl="recurring.aspx" />
    			<item Text="(!admin.menu.OrderRecurringPending!)" NavigateUrl="recurring.aspx?show=all" />
    			<item Text="(!admin.menu.OrderRecurringImport!)" NavigateUrl="recurringimport.aspx" />
    		</item>
    		<
    		<!-- Help Menu -->
    		<item Text="(!admin.menu.Help!)" LookID="TopItemLook">
    		<item Text="(!admin.menu.OnlineManual!)" NavigateUrl="http://manual.aspdotnetstorefront.com/" Target="_blank"/>
    		<item Text="(!admin.menu.About!)" NavigateUrl="about.aspx?debuglicense=true" />
    	</item>
    </SiteMap>
    I saved the document and tried to log in and got the below error. Can someone please tell me what i did wrong?

    Thanks


    Server Error in '/Storefront' Application.
    --------------------------------------------------------------------------------

    Name cannot begin with the '' character, hexadecimal value 0x0D. Line 13, position 4.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Xml.XmlException: Name cannot begin with the '' character, hexadecimal value 0x0D. Line 13, position 4.

    Source Error:


    Line 121: String MenuConfigFileString = CommonLogic.ReadFile(CommonLogic.SafeMapPath("skin s/skin_" + Page.SkinID.ToString() + "/" + MN), false);
    Line 122:
    Line 123: doc.LoadXml(MenuConfigFileString);
    Line 124:
    Line 125: HierarchicalTableMgr tblMgr;


    Source File: C:\Inetpub\wwwroot\AspDotNetStoreFront\Web\App_Cod e\TemplateBase.cs Line: 123

    Stack Trace:


    [XmlException: Name cannot begin with the '
    ' character, hexadecimal value 0x0D. Line 13, position 4.]
    System.Xml.XmlTextReaderImpl.Throw(Exception e) +76
    System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) +88
    System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String[] args) +18
    System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos) +3932469
    System.Xml.XmlTextReaderImpl.ParseElement() +459
    System.Xml.XmlTextReaderImpl.ParseElementContent() +121
    System.Xml.XmlTextReaderImpl.Read() +45
    System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) +58
    System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +20
    System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +129
    System.Xml.XmlDocument.Load(XmlReader reader) +108
    System.Xml.XmlDocument.LoadXml(String xml) +113
    AspDotNetStorefront.TemplateBase.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\AspDotNetStoreFront\Web\App_Cod e\TemplateBase.cs:123
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +50
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

  4. #4
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    The error clearly states an invalid character being thrown. Please check that the string resource value only contains character that is hard to be interpreted by unicode used: (UTF-8 or ISO-8859-1) It would be rather safe to use alphabet.

  5. #5
    Manley is offline Senior Member
    Join Date
    May 2009
    Posts
    118

    Default re

    Thank you for the help I figure out what I was doing wrong. I have one more question how can I hide the common links in the admin site. The common links end up giving them the same access as if I wouldn't have made any changes.

    Thanks

  6. #6
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Could you specify those common links so that I could provide you with the appropriate procedure?

  7. #7
    Manley is offline Senior Member
    Join Date
    May 2009
    Posts
    118

    Default Re

    On the admin site there is a section that says common links it is on the left hand side just under home. attached is a screen shot of what i am talking about

    thanks for your help
    Last edited by Manley; 06-23-2009 at 02:52 PM.

  8. #8
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    The only thing you can do here is modify the admin/splash.aspx.cs page to not show that panel to certain users. For example, you can make this only available to super admins by adding the following code in the Page_Load method in splash.aspx.cs
    Code:
    if (!ThisCustomer.IsAdminSuperUser)
    {
        pnlCommonLinks.Visible = false;
    }
    If you wanted to create a customer level that you'll apply to all of your admin users that can see the panel of common links, you could do something like
    Code:
    if (ThisCustomer.CustomerLevelID == #)
    {
        pnlCommonLinks.Visible = false;
    }
    where # is the ID of the customer level you've created for your admin users.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  9. #9
    vkundu is offline Junior Member
    Join Date
    Feb 2010
    Posts
    1

    Default left bar navigation on admin site

    We have a similar requirment where the admin site left hand side bar( Common Links, System Information, Security Alert) be only available to SUPERADMIN and other admin should not be able to see these links.

    As shown above we tried modifying the admin/splash.aspx.cs page to not show that panel to certain users. But it is still available to all users. If there something else we need to look at.

    We are in development phase.

    Any help will be greatly appreciated.

    Code:
    if (!ThisCustomer.IsAdminSuperUser)
    {
    pnlCommonLinks.Visible = false;
    }
    Attached Files Attached Files

  10. #10
    mikemike1 is offline Junior Member
    Join Date
    Jun 2010
    Posts
    25

    Default

    Is there a way to meet the same requirement in version 9, now that the admin menudata.xml file doesn't exist?

  11. #11
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Mike, that can be done in v9, yes. See restricting admin users on certain menus in the admin (v9).doc file.

  12. #12
    mikemike1 is offline Junior Member
    Join Date
    Jun 2010
    Posts
    25

    Default

    Thanks! Very helpful. Now, I have the same challenge as vkundu, where the 'common links' menu still allows these admin users to access those features. How can those be removed?

  13. #13
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Mike, those can be remove in {root}/admin/default.aspx file. From there, you can see a panel like, <asp:Panel ID="pnlCommonLinks" runat="server">, comment out those lines.

  14. #14
    texasgirl is offline Junior Member
    Join Date
    Jul 2011
    Posts
    2

    Default commenting out menu items is not working

    I get an error when following the doc for removing the menu bar. I followed the directions and when logged in as an "admin" The main navigation bar only displays this error:

    admin.menu.loaderror

    Can you assist please?

  15. #15
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    That's a generic 'something didn't work right with the menu' message. You'll need to go to Configuration->Maintenance->View System Log in the admin console and get the full error details. If you can't figure out what's going wrong from that, post the full error here and we'll take a look.

  16. #16
    mlogan is offline Junior Member
    Join Date
    May 2010
    Posts
    12

    Default

    Quote Originally Posted by AspDotNetStorefront Staff - Alfred View Post
    Mike, that can be done in v9, yes. See restricting admin users on certain menus in the admin (v9).doc file.
    That did exactly what I wanted and it worked the first time, great instructions. Thanks to whoever wrote that.

  17. #17
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Does anyone know if this can be done in an earlier version, such as 8? How would I find the version anyway?

  18. #18
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Nevermind... super easy. I figured it out. Just copy menuData.xml and call is menuData2.xml. Then open up TemplateBase.cs and go to the Page_Load event and add this in there:

    if (Page.ThisCustomer.Notes == "no-menu")
    {
    MN = "menuData2.xml";
    }

  19. #19
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Sorry... you want to put in the if clause where it is checking to see if you are in the AdminSite:

    if (AppLogic.IsAdminSite)
    {
    if (Page.ThisCustomer.Notes.Trim().Length != 0 && Page.ThisCustomer.Notes.IndexOf(".xml", StringComparison.InvariantCultureIgnoreCase) != -1)
    {
    MN = Page.ThisCustomer.Notes.Trim();
    }
    }

    And change it to:

    if (AppLogic.IsAdminSite)
    {
    if (Page.ThisCustomer.Notes.Trim().Length != 0 && Page.ThisCustomer.Notes.IndexOf(".xml", StringComparison.InvariantCultureIgnoreCase) != -1)
    {
    MN = Page.ThisCustomer.Notes.Trim();
    }

    if (Page.ThisCustomer.Notes == "no-menu")
    {
    MN = "menuData2.xml";
    }
    }

  20. #20
    Upscale_Automotive is offline Senior Member
    Join Date
    Apr 2008
    Posts
    201

    Default

    Quote Originally Posted by George the Great View Post
    The only thing you can do here is modify the admin/splash.aspx.cs page to not show that panel to certain users. For example, you can make this only available to super admins by adding the following code in the Page_Load method in splash.aspx.cs
    Code:
    if (!ThisCustomer.IsAdminSuperUser)
    {
        pnlCommonLinks.Visible = false;
    }
    If you wanted to create a customer level that you'll apply to all of your admin users that can see the panel of common links, you could do something like
    Code:
    if (ThisCustomer.CustomerLevelID == #)
    {
        pnlCommonLinks.Visible = false;
    }
    where # is the ID of the customer level you've created for your admin users.

    Piggy-backing off this solution, you can do the following to simply redirect to a completely different landing page.
    Code:
    			if (!ThisCustomer.IsAdminSuperUser)
    			{
    			  Response.Redirect("newlandingpage.aspx");
    				  base.OnLoad(e);
    			}