Database Reference
In-Depth Information
Read-Only Items
Normally, users can edit the contents of an item in APEX. There are instances where
you want to prohibit them from doing so, but you don't want to hide the item entirely.
At the conclusion of the previous step, the user Martin doesn't have the ability to save
edits of the ticket information even though the form allows Martin to change the con-
tents of the form items.
To assist in preventing changes, each item in APEX has a read-only attribute that
you can set programmatically. The approach is similar to how item conditions are man-
aged. Because the read-only attribute can't use an authorization scheme directly, you
can use the APEX API APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION to de-
termine whether a user has the rights to edit the data. This API takes a parameter of the
authorization scheme name and runs the verification returning a Boolean result that can
be used in PL/SQL logic.
Here are the steps to use the read-only attribute and the API just discussed:
1.
Navigate to and edit the items indicated in Table 9-1 by double-clicking the
item name on the respective page.
Table 9-1 . Items That Require the Read-Only Attribute
Page Number
Page 210
Page 220
P210_SUBJECT
P210_DESCR
P210_ASSIGNED_TO
P210_CREATED_BY
P210_CLOSED_ON
P210_STATUS_ID
P210_PUBLIC_FLAG
P220_DETAILS
P220_ATTACHMENT
P220_CREATED_BY
Items to Update
2.
In the Read Only section, set Read Only Condition Type to PL /SQL
Function Body Returning a Boolean , as shown in Figure 9-32 . Set the
value for Expression 1 to the following:
RETURN NOT
APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION('access
control - edit');
 
 
 
Search WWH ::




Custom Search