Updating Who Can View Each Row
Updating Who Can View Each Row
The procedure to do this is:
-
From the Management Portal home page, go to the SQL page (System Explorer > SQL) page.
-
Select the namespace that contains the table.
-
Click Execute Query.
-
In the editable area, issue a statement to update the table. It should have the following form:
UPDATE MySchema.MyClass SET rlsprop = MySchema.SecurityPolicy(MySQLColumnName1, ...)
where
-
MySchema is the schema (package) containing the class.
-
MyClass is the name of the class.
-
rlsprop is the field containing the list of users and roles who can read the row. This is %READERLIST by default and the property name specified in the declaration of the ROWLEVELSECURITY parameter otherwise.
-
SecurityPolicy is value specified by the SqlName value in the definition of the %SecurityPolicy() method. If there is no explicit SQL name for the %SecurityPolicy() method and its class is MySchema.MyClass, then its default name is myClass_sys_SecurityPolicy (with a fully qualified form of MySchema.MyClass_sys_SecurityPolicy).
-
MySQLColumnName1, ... is the set of SQL column names corresponding to the arguments, if any, defined in the %SecurityPolicy() class method.
-
-
Click Execute.
-
If desired, re-create any view that you initially removed.