emtau Posted April 18, 2023 Posted April 18, 2023 So I have a bunch of staff records. I want a staff to be able to login and the database will show only his/her record and not other staff records. So I disabled the Status bar upon login and apply the script below to show only his/her record when staff access the records: Set Error Capture [On] Go to Layout [Staff Records] Show All Records Go to Record/Request/Page [First] Loop If [Staff Records::Account Name] Go to Record/Request/Page [Next; Exit after last:On] Else Omit Record End If End Loop This works well the staff is now landed on his/her own staff record and not other staff records, but then if I press the keyboard Shortcut CNTR-F I am able to find other staff records. So If only I can disable this keyboard shortcut CNTR-F then all will be fine. Can anyone shed some light on this please.
comment Posted April 18, 2023 Posted April 18, 2023 (edited) You are approaching this from the wrong end. If you don't want your users to see certain records, then restrict their viewing privileges in Manage Security. Then any find they perform (or that you perform for them) will automatically omit the records which they are not allowed to view. And even if they do Show Omitted or Show All Records (which you can prevent by restricting the available menu commands or by installing a custom menu), all they will see are <No Access> labels and none of the data. Edited April 18, 2023 by comment 1
emtau Posted April 18, 2023 Author Posted April 18, 2023 26 minutes ago, comment said: If you don't want your users to see certain records, then restrict their viewing privileges in Manage Security. So I tried this approach but ended up with no luck as I am lost since I'm not quite sure which settings to change etc. I created two Privilege Set groups "Junior" and "Senior", the idea is that if the staff is under a "Junior" Privilege Set group, then he/she will only see his/her own record. If the staff is under "Senior" Privilege Set group then he/she will be able to view all other staff records. Can you please show me what to change in the "Junior" Privilege Set group so that they will only see their own record and not other records?
Solution LaRetta Posted April 19, 2023 Solution Posted April 19, 2023 (edited) Select Junior privilege set and EDIT Select Records and specify Custom Select the Staff Records table (you can repeat on View, Create, Delete or Field Access). On Edit, select 'limited' and enter a calculation which will produce a boolean TRUE (yes) similar to: Get ( AccountName ) = Staff Records::Account Name This will allow the User to edit Staff records when they match the record's Account Name. Since Senior can edit all records, no restrictions need to be set on their privilege set. Reworded a bit for clarity. Edited April 19, 2023 by LaRetta 1
emtau Posted April 24, 2023 Author Posted April 24, 2023 Greetings again, I'm not sure if I should start a new threat but its kind of an extension of this topic so for the part that resolved my issue by LaRetta, I would like to know how; if a user is logged in and he is able to view only his Staff Record, how can I set that he/she cannot edit fields in his records except only the ones I set to be editable?
comment Posted April 24, 2023 Posted April 24, 2023 34 minutes ago, emtau said: he/she cannot edit fields in his records except only the ones I set to be editable? What does "ones" refer to: fields or records?
emtau Posted April 24, 2023 Author Posted April 24, 2023 (edited) 9 hours ago, comment said: What does "ones" refer to: fields or records? Fields. For example I have staff records table with fields, Name, Surname, Gender, Date of Birth, Occupation, Phone number, Address, etc. I wanted a staff to login and view only his/her record and not other staff records. This has been solved. Now I want that same staff to be able to edit for example ONLY Phone number and Address fields and not other fields on his record. Edited April 24, 2023 by emtau
comment Posted April 25, 2023 Posted April 25, 2023 3 hours ago, emtau said: I want that same staff to be able to edit for example ONLY Phone number and Address fields and not other fields on his record. In the users privilege set, select Records: Custom privileges… Then select the Staff table and choose Field Access: limited… Then change the privilege of all fields except Phone number and Address to "view only". 1
emtau Posted April 25, 2023 Author Posted April 25, 2023 1 hour ago, comment said: Then change the privilege of all fields except Phone number and Address to "view only". This solved my problem. Thanks a lot you guys.
Recommended Posts
This topic is 829 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now