Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Scout/Tutorial/3.8/Minicrm/Permissions"
(Working on authorization and authentication) |
(Person form) |
||
Line 18: | Line 18: | ||
This chapter assumes that you're pretty proficient at creating tables, forms and services. No more hand-holding. :) | This chapter assumes that you're pretty proficient at creating tables, forms and services. No more hand-holding. :) | ||
+ | |||
+ | == Database == | ||
+ | |||
+ | The sample database already contains the following tables: | ||
+ | |||
+ | ROLE ROLE_PERMISSION USER_ROLE | ||
+ | --------- --------------- --------- | ||
+ | ROLE_NR ROLE_NR USER_NR | ||
+ | NAME PERMISSION_NAME ROLE_NR | ||
+ | |||
+ | The PERSON table has a USERNAME column. | ||
+ | |||
+ | We don't need to make any changes. | ||
+ | |||
+ | == Person Form == | ||
+ | |||
+ | Create a Person Form and a Person Process Service to create and edit persons. | ||
+ | |||
+ | {| cellpadding="10" | ||
+ | !Field Name | ||
+ | !Column Name | ||
+ | !Type | ||
+ | |- | ||
+ | |Name | ||
+ | |LAST_NAME | ||
+ | |String | ||
+ | |- | ||
+ | |First Name | ||
+ | |FIRST_NAME | ||
+ | |- | ||
+ | |Employer | ||
+ | |COMPANY_NR | ||
+ | |SmartField | ||
+ | |- | ||
+ | |Username | ||
+ | |USERNAME | ||
+ | |String | ||
+ | |- | ||
+ | |Roles | ||
+ | |USER_ROLE.ROLE_NR | ||
+ | |Listview | ||
+ | |} | ||
+ | |||
+ | == Administration View == | ||
+ | |||
+ | Create the following outline on the client side: | ||
+ | |||
+ | Administration Outline | ||
+ | │ | ||
+ | ├─Role Table Page | ||
+ | │ │ | ||
+ | │ └─Permission Table Page | ||
+ | │ | ||
+ | └─Permission Table Page | ||
+ | |||
+ | Additional table pages might be useful: which roles use a particular permission? which users have a particular role? These are left as an exercise for the reader. |
Revision as of 04:24, 24 October 2012
The Scout documentation has been moved to https://eclipsescout.github.io/.
What is this chapter about?
This chapter is about authorization and authentication.
When creating forms and table pages, the wizards have always created Permission classes in the background:
- CreateCompanyPermission
- ReadCompanyPermission
- UpdateCompanyPermission
- DeleteCompanyPermission (actually, you will have to create this permission yourself if you implement a delete menu)
We want to create an Administration View where Users get assigned Roles. These Roles have have Permissions. When a user logs in, the appropriate Permissions are loaded.
For this to work, users must be authenticated. We'll add a SecurityFilter to handle this.
This chapter assumes that you're pretty proficient at creating tables, forms and services. No more hand-holding. :)
Database
The sample database already contains the following tables:
ROLE ROLE_PERMISSION USER_ROLE --------- --------------- --------- ROLE_NR ROLE_NR USER_NR NAME PERMISSION_NAME ROLE_NR
The PERSON table has a USERNAME column.
We don't need to make any changes.
Person Form
Create a Person Form and a Person Process Service to create and edit persons.
Field Name | Column Name | Type |
---|---|---|
Name | LAST_NAME | String |
First Name | FIRST_NAME | |
Employer | COMPANY_NR | SmartField |
Username | USERNAME | String |
Roles | USER_ROLE.ROLE_NR | Listview |
Administration View
Create the following outline on the client side:
Administration Outline │ ├─Role Table Page │ │ │ └─Permission Table Page │ └─Permission Table Page
Additional table pages might be useful: which roles use a particular permission? which users have a particular role? These are left as an exercise for the reader.