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

Rights in the CE10

Status
Not open for further replies.

sasa888

Programmer
Oct 15, 2001
131
US
Hi all, I would like to know if there is a way to retrieve the rights of reports within infoobjects please? Thanks in advance.
 
See if this helps. Hopefully you won't need the stuff from the #include files, but let me know.
- Mike
Code:
<%
On Error Resume Next

'Declare a variable to hold the ID of the parent folder for the reports.
'Retrieve the Folder ID from the querystring.
Dim MyFolderID
MyFolderID = Request.QueryString("id")
Dim MyFolderParentID
MyFolderParentID = Request.QueryString("folderid")

'Create a link back to the folder navigation page, using the parent folder ID.
Response.Write "<A HREF=NewFolderNavLC.csp?id=" & MyFolderParentID & "><p align=right><B>Back</B></p></A>"

'Retrieve the sort option from the querystring	' Added 12/17/2003 MJD
Dim MySortOpt
Dim so0, so1
so0 = ""
so1 = ""
MySortOpt = Request.QueryString("sortopt")
If MySortOpt = 1 then
	so1 = "checked"
Else 'MySortOpt = 0 or null (default)
	so0 = "checked"
End If



FolderNameHeader()
Dim MyReportsCol
Set MyReportsCol = GetFolderReports()
OpenReportTable()
BuildReportRows( "Properties")
CloseReportTable()

'Release the objects so that they do not take up unnecessary memory space.
Set MySessionMgr = nothing
Set MySession = nothing
Set MyInfoStore = nothing
Set MyFoldersCol = nothing
Set MyFolder = nothing
Set MyReportsCol = nothing
Set MyReport = nothing

'Duplicate the link to send the user back to the folder navigation page.
Response.Write "<A HREF=NewFolderNavLC.csp?id=" & MyFolderParentID & "><p align=left><B>Back</B></p></A>"

%>

<%
function GetMyProperties(MyReportID)
'We will use the Report ID to query the APS to return information 
'about this report so that we can use it in a title on the page.
Dim MyQuery
MyQuery = "SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_ID=" & MyReportID 

'Declare a variable to hold the Reports collection and query the APS 
'to retrieve the Report to place in the collection.
Dim MyReportsCol
Set MyReportsCol = MyInfostore.Query(MyQuery)

If err.number <> 0 then 
	Response.Write "There was an error creating the Reports Collection."
Else
	'Declare a variable to hold the individual Report 
	'There is only one report in the collection, so retrieve it, 
	'then display its name in a title.
	Dim ThisReport
	Set ThisReport = MyReportsCol.item(1)
	If err.number <> 0 then
		Response.Write "There was an error creating the Info Object."
	End if
End if

	dim reportObj
	set reportObj=ThisReport

	dim ReportSecInfo
	dim ObjPrincipal
	dim ObjPrLimits, ObjPrRights
	dim Limit, Right
	dim pID, pName
	
	dim pLoop, lLoop
	
   ' Get the security information for the Report object.
	Set ReportSecInfo = reportObj.SecurityInfo

	dim pb, lb
	pb=0
	lb=0
	Response.Write "<table width='100%' border=" &pb& ">"
	' Loop through each "principal" (group or user) for the folder
	For pLoop = 1 to ReportSecInfo.ObjectPrincipals.Count
		' Get the report Limits for the current "principal"
		pID = "#" & ReportSecInfo.ObjectPrincipals.Item(pLoop).ID
		pName = 	ReportSecInfo.ObjectPrincipals.Item(pLoop).Name
		Set ObjPrincipal = ReportSecInfo.ObjectPrincipals.Item(pID)
		If Err.Number <> 0 Then
			Response.Write "<B>* Any-Principal Used *</B>"
			Set ObjPrincipal = ReportSecInfo.AnyPrincipal(1)
			Err.Clear
		End If
		
		' Put a line before each subsequent Principal
		if pLoop > 1 then
			Response.Write "<tr><td colspan=2><hr></td></tr>"
		end if
		
		Set ObjPrLimits = ObjPrincipal.Limits
		Set ObjPrRights = ObjPrincipal.Rights
		Response.Write "<tr><td>" & pName & "</td><td>"
		Response.Write "<table width='100%' border=" &lb& ">"
		for lLoop = 1 to ObjPrLimits.Count
			Set Limit = ObjPrLimits.Item( lLoop)
			Response.Write "<tr><td>" & Limit.Description & "</td>"
			Response.Write "<td>" & Limit.Value &" </td></tr>"
		next
		for lLoop = 1 to ObjPrRights.Count
			Set Right = ObjPrRights.Item( lLoop)
			Response.Write "<tr><td>" & Right.Description & "</td>"
			Response.Write "<td>" & Right.Granted &" </td></tr>"
		next
		Response.Write "</table></td></tr>"
	next
	Response.Write "</table>"

'Release the one local object so it doesn't take up unnecessary memory space.
Set ThisReport = nothing

end function 'GetMyProperties()
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top