1. Create a User Event script and deploy to records that require permissions (or all records).
2. Create a BEFORE LOAD FUNCTION that checks custom condition and throws an error if they aren't met. This will prevent the record from being loaded.
Notes:
- nlapiGetContext().getExecutionContext() can be used to have permission apply only in specific contexts (eg Web Store, Web Services, CSV imports or inline editing)
- Can be used in very dynamic ways. An example using roles, context and datetime might be that Employees with the role Sales Person can only do CSV imports of Sales Order records from 9AM-5PM Monday-Friday and can't edit invoice records. Another example would be to prevent inline editing of a customer record for a specific customer.
1. Customization > Lists, Records, & Fields > Lists > New
- Name list Permission Levels
- Add values for permission levels (edit, view, create, full)
- Save
A.
- Name the record Advanced Permissions
- Set permission on the record so that only employees who should be able to change permissions can access the custom record
- Save
- Create a field called Record of type List/Record and set the List/Record to Record Type
- Save
- Create a field called Level of type List/Record and set the List/Record to the list from step 1 (Permission Levels)
- Create a field(s) for custom permission (Eg class, department, date, context, restrict) and then select the appropriate field type
- Save
4. Substitute values in simple script above with variables taken from the search
Note: The fields in step 2B can be designed so that they refer to a field on the record being accessed or the user accessed as long as the script is coded to do so
Creating permissions this way is not intended to replace default NetSuite permissions and logical errors made while customizing the script could potentially cause users to access things not intended if the script doesn't work correctly.
No comments:
Post a Comment