-
Notifications
You must be signed in to change notification settings - Fork 8
HowToFilterData
iraichi edited this page Jun 25, 2015
·
9 revisions
The feature is implemented by the DefaultFilter node at model or view level.
For example, suppose that in your config.yaml file the login ReadUserCommandText is implemented as in the following:
.....
ReadUserCommandText: |
select
A.ID AS USER_NAME, a.PASSWD AS PASSWORD_HASH, a.SYSYEM as SYSTEM, E.ID AS EMPLOYEEID, E.DX AS EMPLOYEEDX
from APPUSER A
LEFT OUTER JOIN employee E ON E.APPUSERCLASS = 'TISUser' AND E.APPUSERID = A.ID
```yaml
Suppose in a model or view you want to show only records of current user.
just write in the model or in the view:
```yaml
.....
DefaultFilter: |
(EMPLOYEEID in (select ID FROM EMPLOYEE where APPUSERID = '%Auth:USER_NAME%'))
```yaml
where `%Auth:USER_NAME%` is a macro expanded by Kitto
a more complex example: you want to show all records in case current user is a system user:
```yaml
.....
DefaultFilter: |
('%Auth:SYSTEM%' = 1 or (EMPLOYEEID in (select ID FROM EMPLOYEE where APPUSERID = '%Auth:USER_NAME%')))
```yaml
- Kitto at a glance
- Getting started
- Setup
-
Basic concepts
- Basic Materials
- Controllers
- Panel-Based
- [List] (List)
- [Form] (Form)
- [GridPanel] (GridPanel)
- [ChartPanel] (ChartPanel)
- [Tool Controllers] (Tool)
- [Login] (Login)
- [Logout] (Logout)
- [ChangePassword] (ChangePassword)
- Features
- Examples
- Developer's guide
- Library reference
- Frequently Asked Questions
- Kitto tips & tricks and how-tos
- Other information
- Kitto Enterprise