Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CE10 Customizing Options 2

Status
Not open for further replies.

mbfloyd

Programmer
Apr 28, 2000
22
US
Hello all,
I am trying to limit the options available to the users in the Customizing options drop down list. It seems that if I allow the users to schedule or run a report, they also have access to the database logon, destinations, printer options, format, parameters. I would like to limit that to just schedule, printer options, and parameters. Does anyone have a clue? or is it me without a clue. Thanks for your help in advance

mbfloyd
 
Use the Advanced Option while setting the security....
 
Thanks for your response, However I did used the Advanced option and was unable to get the desired results.
 
In CE9, look at schedule.csp. In CE10, rptschedule.csp. Search for the string...
Code:
ADD DATABASE LOGON OPTION TO ACTION LIST IF REPORT REQUIRES IT
In that area, you can turn off options globally, or create conditions like allowing the administrator to access all options. I added ...
Code:
var SessionUser = iStore.EnterpriseSession.UserInfo.UserName;	// Added to allow conditional menu by user.
... and then put
Code:
if ( SessionUser == "Administrator" )
in front of restricted options.

Some of my restrictions use more complex criteria than this, but I'll leave it simplified for now.
 
Thanks mdwyer for your response; I am having a problem with restricting the options;
Here is my code:
Code:
// ADD DATABASE LOGON OPTION TO ACTION LIST IF REPORT REQUIRES IT    
    
    if(rpi.NeedsLogon)
      Response.Write("<option value='dblogon'>"+L_DATABASELOGON);  	  

    // ADD PARAMETERS OPTION TO ACTION LIST IF REPORT HAS AT LEAST ONE PROMPT  
    if (npar > 0)
      Response.Write("<option value='parameters'>"+L_PARAMETERS);

    if (GetCachedAdminPref("showschedfilters", DEF_SCHED_FILTERS, "child") == "true")
		Response.Write("<option value='formula'>"+L_RSF);

    if (packageId == "" && CanScheduleToDestinationSystem(iStore.EnterpriseSession))
      Response.Write("<option value='destination'>"+L_DESTINATION);
    Response.Write("<option value='format'>"+L_FORMAT);
    if (CanPrintReportsSystem(iStore.EnterpriseSession))
      Response.Write("<option value='printersettings'>"+L_PRINTSETTINGS);
    Response.Write("</select>");
    Response.Write("</td></tr></table>");
    Response.Write("<script> SetMenu('"+tab+"',document.sform.menu); </script>");
  }

  Response.Write("<hr size=1>");
what do I do to restrict and allow the adminstrator and others to have specific options. I'm really new at csp code.

thanks for your help
mbfloyd
 
See in-line, commented customizations (bold). I've done a number of things that you may or may not want, but the example may be helpful.

Code:
[b]// RE-ORDER AND RESTRICT CE'S MENU OPTIONS
    var SessionUser = iStore.EnterpriseSession.UserInfo.UserName; // Added to allow conditional menu by user.
[/b]
// ADD DATABASE LOGON OPTION TO ACTION LIST IF REPORT REQUIRES IT    

[b]    // Show this option if the logon is not complete, or if the user is Administrator.
    var logonstatus = ""; // Used to clarify logic
[/b]
    if(rpi.NeedsLogon)
        // Determine if logon is complete
        if ( Request.Form.Item("dbname") == ""
          || Request.Form.Item("dbuser") == ""
          || Request.Form.Item("dbpassword") == "" )
            logonstatus = "incomplete";
        else
            logonstatus = "complete";

    if ( logonstatus == "incomplete" || SessionUser == "Administrator" )[/b]
      Response.Write("<option value='dblogon'>"+L_DATABASELOGON);        

    // ADD PARAMETERS OPTION TO ACTION LIST IF REPORT HAS AT LEAST ONE PROMPT  
    if (npar > 0)
      Response.Write("<option value='parameters'>"+L_PARAMETERS);

[b]    // Show Printer Settings immediately after Parameters
    if (CanPrintReportsSystem(iStore.EnterpriseSession))
      Response.Write("<option value='printersettings'>"+L_PRINTSETTINGS);
[/b]
    if (GetCachedAdminPref("showschedfilters", DEF_SCHED_FILTERS, "child") == "true")
[b]      if ( SessionUser == "Administrator" ) // Available only to Administrator.[/b]
        Response.Write("<option value='formula'>"+L_RSF);

    if (packageId == "" && CanScheduleToDestinationSystem(iStore.EnterpriseSession))
      Response.Write("<option value='destination'>"+L_DESTINATION);
    Response.Write("<option value='format'>"+L_FORMAT);
[b]    // (moved Printer Settings option up)[/b]
    Response.Write("</select>");
    Response.Write("</td></tr></table>");
    Response.Write("<script> SetMenu('"+tab+"',document.sform.menu); </script>");
  }

  Response.Write("<hr size=1>");
You can expand this to other named users, of course, but if you want to grant/deny privileges based on Groups you'll need more advanced code. I may have posted a callable subroutine in another thread a couple of months back.
 
Thanks alot, mdwyer this works great. And yes I would be interested in grant/deny privileges based on groups, however I have searched other threads and have not been lucky so far. I'll keep checking...again thanks alot.

mbfloyd
 
Thank you, sv.

mbfloyd: Have a look at thread782-916798. Let me know if more help is needed.

- Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top