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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced Rights in CMC (CE10)

Status
Not open for further replies.

Bobbber

Programmer
Sep 6, 2002
83
TR
Hi all,

I have created a new group and a new user on CE10. I have assigned this user to the group.

I have a new report, in a new folder.

I am now trying to modify the Advanced Rights for the group over the report - with the intention of only allowing the user to see instances in the history which they scheduled.

Is this possible? I've played around with the rights, and only seem to be able to switch the 'History' link on and off in the 'available.csp' screen.

When I toggle it off, the only action available to the user is 'Schedule'. When they schedule a report - the history screen is shown with only their instances (that's what I want, but with the 'History' link visible on the Available screen too)....

Any help appreciated...




Stay Blue, Bob. x
 
I did this through customization of .csp code in CE9. My guess is that's how you'll have to do it. I'll see if I can post the code tomorrow.
 
In the CMC if you go to groups then select the required group then select the rights tab then in the Access Level drop down list select view.
 
We use CE primarily for one group of users to see a set of financial and budget reports, which are organized into forlders by report category. Some reports are standard and are run once a night for all users under the Administrator account. Others are user-scheduled and take parameters according to the user's needs. Admin-run reports need to be seen by everyone, but user-scheduled reports should be seen only by that user.

We have customized the code in history.csp and in schedule.csp to implement this requirement - and synchronize the instance counts with the accessible instances.

In history.csp, the WHERE clause on the instance query has been extended as shown below. The bold line is the search string you would use to find the code insertion point in the file.

Code:
[b]var whereClause = "SI_PARENTID = " + id;[/b]
if ( userName != 'Administrator') // Set a condition for limiting the instances.
{
    whereClause += " AND SI_OWNER IN ('Administrator', '" + userName + "')"; // Limit to reports run by user or Administrator.
    whereClause += " AND NOT (SI_SCHEDULEINFO.SI_ENDTIME = '4712.12.31' AND"; // Exclude reports scheduled to eternity...
    whereClause += "          SI_SCHEDULEINFO.SI_SUBMITTER != '" + userName + "')"; // ...by someone else, i.e., Administrator.
}

In available.csp, the code change deals with the instance count displayed for each report, and with the View Last Instance option. (A user can only view the "last" instance if was run by that particular user - or by the Administrator.)

Two custom functions were added at the end of the file:

Code:
function LC_CountHistoryInstances( instanceID)
// This function will count instances not scheduled to eternity by someone else, i.e. Administrator.
{
	var qry = "SELECT si_id, SI_SCHEDULEINFO FROM CI_INFOOBJECTS ";
	qry  +=   "WHERE SI_PARENTID = '" + instanceID + "' ";
	
	if ( username != 'Administrator' ) {	// Limit the instances counted (to match history instances displayed).
	    qry += "AND SI_OWNER IN ('Administrator', '" + username + "')";				// Limit to reports owned by the user or Administrator.
		qry += "AND NOT ( SI_SCHEDULEINFO.SI_ENDTIME = '4712.12.31' AND ";			// Exclude instances for "eternity"... 
		qry += "          SI_SCHEDULEINFO.SI_SUBMITTER != '" + username + "' )";	// ... scheduled by someone else.
	}
	var histInst = iStore.Query(qry);

	return histInst.Count;
}

Code:
function lcSecurity( actionItemID, instId, username)
// This function is used to disable View Last Report if the (latest) instance 
// is not owned by the logged-on user (unless the user or owner is Administrator).
{
	if ( actionItemID == -10008 && instId != -1)	// -10008 is View Last Report
		try
		{
			var lastInstOwner = rsLastInst.Item("#" + instId).Properties.Item("SI_OWNER").value;
			if ( username != "Administrator" && username != lastInstOwner &&  lastInstOwner != "Administrator")
				return false;
		}
		catch(e)
		{
			return true;
		}
	return true;
}

Calls to the lcSecurity() function were added to code located in the functions WriteActions() and DisplayActionItem. Use the bold text as a search string to find the 2 locations.

Code:
//[b]if( secinfoObj.CheckAction(actionItem.ID) )[/b]	// Replaced with ...
if( secinfoObj.CheckAction(actionItem.ID) && lcSecurity( actionItem.ID, instId, username) )	// User test added.

Calls to the LC_CountHistoryInstances() function were added to code located in the functions DisplayThumbnailItem(), DisplayListItem(), and DisplayActionItem(). Use the bold text as a search string to find the 3 locations.

Code:
//Response.Write("<div class='list'>" + [b]L_INSTANCES + realObj.Properties.Item("SI_CHILDREN")[/b] + "</div>" + vbCRLF);	// Replaced with...
Response.Write("<div class='list'>" + L_INSTANCES + LC_CountHistoryInstances( realObj.Properties.Item("SI_ID")) + "</div>" + vbCRLF);	// Show count that History will display.

(The "reports scheduled to eternity" are schedules entered in the CMC, by Administrator, for a very future date. The purpose is to link the object to a File Event, which cannot be done in ePortfolio. As long as the schedule is outstanding, however, reports scheduled in ePortfolio are also dependent on this Event. The date, while arbitrary, was not chosen at random, as Oracle Applications analysts will recognize.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top