of_getpermissions


pfcapsrv.pbl   >   pfc_n_cst_security   >   of_getpermissions   

Full name pfc_n_cst_security.of_getpermissions
Access public
Extend of string
Return value string
Prototype public function string of_getpermissions(string,string)

Name Datatype
No Data

Name Datatype
ll_rowcount long
ls_origfilter string
ls_status string

public function string of_getpermissions (string as_object, string as_control);//////////////////////////////////////////////////////////////////////////////
//
//	Function:	of_GetPermissions
//
//	Access:		public
//
//	Arguments:
//	as_object		object to check security on
//	as_control		Name of object/control to check security for. 
//
//	Returns:		string
//					ENABLED, DISABLED, NOTSET, INVISIBLE
//					'!' = Error
//
//	Description:
//		Checks the security table to get the objects permission
//	
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

long		ll_rowcount
string	ls_status = NOTSET, ls_origfilter

if IsNull(as_control) or Isnull(as_object) Then Return '!'
If (as_control = '') or (as_object = '') Then Return '!'

// remember what we were looking at before
ls_origfilter = ids_items.Describe("DataWindow.Table.Filter")

is_currfilter = "window=~""+as_object+"~" AND control=~""+as_control+"~""
IF ids_items.SetFilter(is_currfilter) <> 1 then return '!'
IF ids_items.Filter() <> 1 then return '!'

ll_rowcount = ids_items.RowCount()
If ll_rowcount > 0 Then
	// resort in case the filter reordered things
	ids_items.sort() 
	// the first item is the one the security service uses
	ls_status = ids_items.GetItemString(1, 'status')
End If

// set the filter back to what it was
is_currfilter = ls_origfilter
IF ids_items.SetFilter(ls_origfilter) <> 1 Then Return '!'
IF ids_items.Filter() <> 1 Then Return '!'

il_numberofrows = ids_items.RowCount()
// resort in case the filter reordered things
ids_items.sort() 

Return ls_status
end function

     
Name Owner
No Data

     
Name Owner
datastore.describe datastore
datastore.filter datastore
datastore.getitemstring datastore
datastore.rowcount datastore
datastore.setfilter datastore
datastore.sort datastore
systemfunctions.isnull systemfunctions

     
Full name
No Data

     
Name Scope
No Data