|
|
|
|
|
|
Login
|
erp5.org has permanently moved to wiki.erp5.org ! Current status of ERP5 community websites:
Note: if you created content in this ancient portal, please migrate it to the wiki. The old website will stay online as long as all contents are not mograted to the wiki.
ERP5 5A Security Model
This documents the basic 5A security model in ERP5 and how to apply the model to a real implementation such as Accounting.
Caution: This is still in a draft state. Need to add more text and fix the issue of Z SQL Method. IntroductionSecurity is essential in most companies, because each person should not be able to do what the person should not do. An example is that only qualified accountants should be able to validate accounting transactions, because this is a legal procedure. Another one is that an ordinary worker should not be allowed to make a new purchase order or modify exisiting orders without approval by a manager. This means that we need a certain way to prevent people from doing what they should not do. One way of doing this is to specify what a given user can do and cannot do, but this could be a nightmare, because if you have 100 workers in your company, you must set up permissions 100 times. Zope addresses this question by roles. For example, if your company has two accountants, it would be a good idea to make a role called Accountants and set up permissions for the role Accountants instead of specifying permissions for the two accountants separately. This reduces the number of permissions that you must set up dramatically and this makes the cost of maintenance much cheaper. This role-based security is, however, still hard to maintain, if you have many modules in ERP5. Suppose that you have two modules for sale orders and accounting transactions. In these modules, probably you will define the roles Sale Manager and Accounting Manager so that some restricted people can make final decisions or legally important jobs. And, you will need more roles for ordinary workers, such as Accountant and Sale Assistant. The number of roles grows up as you add a new module into ERP5. If you have 20 modules, the number can become over 40. In this case, you must maintain the big table of permissions, because the size of the table is determined by the number of permissions times the number of roles. Even worse, this makes things complex, because Sale Manager is a completely independent role of Accounting Manager. ERP5 reduces the number of roles significantly and provides a clear vision of the security system thanks to the 5A security model. 5A stands for Author, Auditor, Assignor, Assignee and Associate. These are roles which can be used to define permissions for users in a generic form, regardless of modules. Also, ERP5 uses some built-in roles in Zope such as Owner. 5A Security ModelERP5 provides a simple and consistent view of business security by the 5A model. 5A consists of five generic roles: Author, Auditor, Assignor, Assignee and Associate. Users are associated with these roles in per-module basis by local roles in each module. Local roles are roles which are effective only in a specific module or document, so it is possible to use a limited number of generic roles to decrease the comlexity of the security problem. Here we describe what each generic role means:
Also, ERP5 uses the role Owner which is a standard role in Zope. Owner is automatically assigned to a user, when the user makes a new document. So if you are willing to allow an author to view documents owned by the author, you can specify proper permission settings based on Owner. How to set permissions for 5APermissions are set by the combination of static settings in modules and workflows. Module-level security is used to determine who can make new documents, who can modify existing documents, who can delete existing documents and who can view existing documents. Because this is settings in a module, this does not distinguish documents. If you need to make difference among documents - like Assignee - then you must use document-level securiry. On the other hand, document-level security is used to determine who can modify a given document, who can view a given document and who can change the state of a given document. So this security is important in particular for Assignee and Associate. Document-level security is sometimes set at a document level and sometimes acquired from a module which contains this document. The security on a module should not be basically acquired from the security on the parent of the module. The parent is usually a portal object (i.e. an ERP5 Site) and the permissions should be very different from each module in the portal. That is, for example, because a portal can be viewed even by Anonymous in part to make it possible to login via a web interface. In additional, each module may have local roles which are independent of global roles set in the portal. The details about how to set up permissions depends on the policy of your site / module. But this is the principle in module-level security:
In document-level security, permissions are managed by workflows. DC Workflows used in ERP5 support setting permissions based on the state of a document and they can limit who can do a given transition of a state. So permissions for a document is configured by setting up one or more workflows used for the document precisely. For the permission settings in a workflow, you should add at least these permissions:
"Access contents information" is basically the same as "View". So these should be enabled for Assignee, Assignor, Associate and Auditor but not for Author, because Author may not view documents by definition. Also, you can enable these permissions for Owner so that Author can view documents only if the documents are created by the Author. "Modify portal content" should be allowed for Assignee, Assignor, and optionally for Owner. But even if you want to allow Owner to modify documents, you should not allow that in some status, such as stopped in Accounting Transactions, because changing validated transactions is illegal. The same thing can be applied even to Assignor, because closed Accounting Transactions should not be modified by anyone. Also, permissions must be set for transitions. Transitions are used to change the state of a document, so this is a kind of modification on existing documents. You can define who can do a transition by specifying required roles. Case Study: AccountingIn accounting, security is extremely important, because of the laws that only qualified people (i.e. accountants) may validate accounting transactions. Here, we see how to set up the security for accounting. The 5A roles are considered like this in accounting:
First, the module accounting defines who can view the module itself, who can make new documents, who can delete documents, and so on. Basically, all 5A roles must be able to look at the module. So these are the results:
Secondly, let's set up the workflow accounting_workflow. This workflow is used for all portal types based on accounting transactions (Pay Sheet Transaction, Purchase Invoice Transaction, etc). Here two things must be set up:
TO BE WRITTEN... Resources |
|
|