|
of_setsecurity
|
|
Full name
|
pfc_n_cst_security.of_setsecurity
|
Access
|
public
|
Extend of
|
boolean
|
Return value
|
boolean
|
Prototype
|
public function boolean of_setsecurity(graphicobject)
|
Name
|
Datatype
|
l_aww
|
classdefinition
|
l_class
|
classdefinition
|
li_rc
|
integer
|
lm_menu
|
menu
|
ls_objname
|
string
|
ltab_tab
|
tab
|
luo_object
|
userobject
|
public function boolean of_setsecurity (graphicobject ago_obj);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_SetSecurity
//
// Access: public
//
// Arguments :
// ago_obj object to have security set for
//
// Returns: Boolean; (True if security was set otherwise false)
//
// Description: Sets the security for the passed object. For this function to work properly
// the of_init function MUST have been called first.
//
// Note: This function can be used to secure dynamically created objects
//
//////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////
string ls_objname
integer li_rc
classdefinition l_class, l_aww
menu lm_menu
userobject luo_object
tab ltab_tab
// check arguments
If IsNull(ago_obj) or Not IsValid(ago_obj) Then Return False
// check if security was set
if not ib_initsecurity then return false
// 6.0 metaclass information feature
l_class = ago_obj.classdefinition
l_aww = l_class.parentclass
if not isnull(l_class.parentclass) then l_class = l_class.ancestor
ls_objname = l_class.name
IF of_LoadSecurity(ls_objname) < 1 then return false
il_numberofrows = ids_items.RowCount()
choose case l_class.datatypeof
case 'menu'
lm_menu = ago_obj
of_setmenu(ls_objname, lm_menu)
case 'userobject'
luo_object = ago_obj
of_SetControlArray(ls_objname, luo_object.control, '')
case 'tab'
ltab_tab = ago_obj
of_SetControlArray(ls_objname, ltab_tab.control, '')
case 'datawindow'
of_setcontrolstatus ( ago_obj, ls_objname, '', '' )
case else
of_setcontrolstatus ( ago_obj, ls_objname, '', ls_objname )
end choose
return true
end function