The following code is an example of applying security by modifying the data being returned, as appropriate for the user who is retrieving the data.
Please note that attribute level security can be applied to some extent at the template level.
Please note that the Process Before Code may need to 'reverse out' this security; for example, if the value of an attribute was not passed back from the Process After Code due to security restrictions, the Process Before Code would need to take that into account when that attribute is passed back as blank from the browser. Ie, in this circumstance, the Process Before Code may need to determine that the user was not allowed to see this data, and to reset that attribute, in order to prevent the value of the attribute being lost. Resetting the value of the attribute to null or blank in the Process Before Code, as appropriate, would achieve this.
Sample code is:
SUBROUTINE MAILBOX_CUSTOMER_After(Command,RawData,Instance,Instance_Key,ErrorMessage,Occurrence,DatabaseeClassList,KeyList,InstanceList,ErrorMessageList,SequenceList,NoUpdateFlagList,CurrentSelect,CascadeRecurse,Cascade_Cascade_KeyList,Cascade_CascadeToKeyList,PreviousDatabaseeClassList,PreviousKeyList,PreviousDateTimeWrittenList,PreviousNoUpdateFlagList,User,MetaErrorFlag)
$INCLUDE FB_BP Freedombase_Definition
$INCLUDE Process_BP MAILBOX_CUSTOMER_Definition
IF FIELD(User,'~',1) = 'guest' AND Instance<MAILBOX_CUSTOMER_BALANCE> NE '' THEN
Instance<MAILBOX_CUSTOMER_BALANCE> = '(hidden)'
END
RETURN
END
| previous | next |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

