Jump to content

Custom Privilege to set per record


Thomkas

This topic is 5123 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hey Guys---

I have been looking on the board and still no luck.

Hopeful someone can help me out [deadline approaching].

We have a solultion here, created a timesheet db for the Accountant here. with a layout with 150 relational fields with 4 critera and some calc fields. Each Record is Each Person in the Employee DB link as a Rec ID Staff (a number). All the Relationships are working correctly and all is working fine so far.

My Main issue though is creating a startup script that looks at the username login, if the login name is staff then limit all records but that user. using a find? or Privillage/ or both. I was also seeing if I need to set a $vars... not a clue. If anyone can help... I would Give Kudos

Bless to be Bllessed,

Thom

Link to comment
Share on other sites

  • Newbies

Thank you for the reply---

Much help is greatly appreciated! so using the Function: Get(RecordAccess)

do I need to create script for this. Can you explain little more about Record Level Access. For I have done a Adv. Search and could not find a clear understanding of it, Thanks For your Time

Link to comment
Share on other sites

Here I have created a quick sample file for you since I couldnt find a sample file to point you to.

Log on with the following account names to test:

Bob

Mary

John

All 3 have blank passwords.

You can also log in with the default Admin user account which also has a blank password.

keywords: Record Level Access

RecordLevelAccess.zip

Link to comment
Share on other sites

  • 4 months later...
  • 3 weeks later...

Speaking of group access. What would be the best practice to control access to record for a group in which there can be many users?

Let say that there are three groups eastern, western and companyAdmin.

Eastern and Western groups cannot see data from each other.

companyAdmin group can see all the data from western and eastern.

Each group can have more than one person who are members.

How can we managed this in FM?

Link to comment
Share on other sites

You would have 3 privilege sets; eastern, western and companyAdmin. Each user would belong to one of these Priv sets. You have your records level access to be true if a field that captures the priv set = the logged in Priv set.

Here is an example of viewing records of those in your same priv set. It uses Men and Ladies as an example.

Log on with the following account names to test:

Admin

Bob

Mary

John

Karen

All have blank passwords.

[color:red]IMPORTANT!

NOTE: While creating this demo I believe I have found a MAJOR BUG. It seems as though there is an issue in FMPA10 with this (havent tested in FMP10). Although records level access using the account name still works fine in FM10, using the privilege set name has issues. It seems as though it doesnt evaluate properly for access. This is NOT an issue with prior verions ( tested on FM9 )

[color:red]UPDATE

It seems that it is a behavior change, not a bug per se.

KB 7161

RecordLevelAccess_PRIV_SET.zip

Link to comment
Share on other sites

Here's another scenario.

A database with some product sales that are located per states (NY, WI, CA, ...).

It is possible to subscribe to the database by states. A company could subscribe only to the sales that are in NY, while another would need all the New England states and another all the west coast state. Each company can only see the data they subscribed to.

Here's my idea :

- productSales (pkProductID,...fkStatesID)

- states(pkStateID,abbreviation, ...)

- rights(pkRightID,fkStateID,fkCompanyID,...)

- companies(pkCompanyID,name,...)

- employees(pkEmployeID,username, firstName,...fkCompanyID)

For the privilege on productSales, I only need to check if the employee's username is in the list of people who have the rights to use the data.


if (Position (list (employees::username); Get (AccountName);1;1);

   true; 

/*else*/

   false

)

What do you think of this solution?

Edited by Guest
Link to comment
Share on other sites

  • 1 year later...

This topic is 5123 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.