3 Replies Latest reply on Jul 24, 2013 9:39 AM by philmodjunk

    Privileges by account name



      Privileges by account name



           I'm working on building an employment database that contains employees that work at a variety of locations whose managers need access to their employment record but I'm tyring to prevent them from accessing employment information for employees who do not work at their location.

           I have two tables that are related by an ID number and here is what each table contains:

           Employee information: Employee name and ID

           Work History: Start and end dates, location, department, etc.

           Right now (for testing only) the username is the location in question, so if an employee is working at Location A, the username is Location A.

           Attached is an image of the security settings.

           For each of the tables, the view is limited by the following calculation: "Work History::Location = Get(AccountName)"

           This works only for one record, if I have more than one employee working at any given location only one shows up in the employee information table, the other records have the "No Access" across almost all of its fields (some are just blank). However, both reocrds do show up in the work history table, just not the employee information table.

           How can I fix this?



        • 1. Re: Privileges by account name

               This should not work for only one record. I don't think that this is exactly what you want, but it should limit access to all records in Work History where location contains text that is exactly the same as the current user's account name.

               Access to records in other tables will be more problematic with this expression as the relationship between that table and the values in match field(s) of that record which then control which record in Work History is being referenced will control which work history record's location field will be compared to the current user's account name to determine access.

          • 2. Re: Privileges by account name

                 Could I create a field in the "Employee Information" table that takes the locations from the work history and limit the view to the following:

             "Employee Information::Location = Get(AccountName)"

                 Then make the security priviliges target that field instead

                 I would need to find a way to make the calculation search the related records and find any record that is active (no end date) and place it there. 

            • 3. Re: Privileges by account name

                   It's not really a question I can answer without knowing quite a bit more about the design of your database and how you need this record level access control set up to work for you.