Giving Access to View Data

Hello,

Currently I'm developing an app where I've created multiple tables such as:
Entity, Function, SubFunction, Document, Access but i'm stuck at this point.

Access: Aid, Did Type Eid Fid Sid User
Type enumlist: individual, entity, function, subfunction

So what i want to achieve is when admin(user) select any type from the form then the user which are in the selected entity, function or subfunction can see the document, also in same function name could be there in different entity but the users will be different.

For example:
1. if Document Name is TEST and after select the entity from the list is "ABC Technology" then user which are in ABC Technology can view the TEST document.

2. if Document Name is TEST and after select the entity from the list is "ABC Technology" and select function from the list is "Operation" then user which are in Operation function of ABC Technology entity can view the TEST document.

Similar for the subfunction, and for individual i want to show the users which are in the user table.

I've tried but couldn't find any solution regarding this.

Please guide me into this situation.

Thanks for the help in advanced.

0 3 107
3 REPLIES 3


@Neel_Zaveri wrote:

I've tried but couldn't find any solution regarding this.

Please guide me into this situation.


AppSheet provides only basic permissioning for apps where the users are white-listed within the app.  In this app configuration, you can set users only to "Admin" or "User" and then use the USERROLE() function within the app to determine which role the user is.

HOWEVER....if you need to go further and identify what company or department a user belongs to,  you will need to build your own Users table that is populated with the login email address, for matching, and any other details needed such as company the user belongs to.  You then lookup the user in the Users table to retrieve any permission settings you need.

FYI:  There is a great implementation strategy written up by @MultiTech .  you can find it here:

Current User (Slice) | How to conform your app around WHO is using the app 

 

Hello @WillowMobileSys ,

Thank You so Much @WillowMobileSys for giving your precious time.

I've already created this tables, what i'm facing is how can i give document access based on Entity, Function, SubFunction and Individual. 

In my user table there are multiple data which resides in different companies, function and subfunction. 

Now simple i want to give them access based on requirements so how can i achieve this ?


@Neel_Zaveri wrote:

In my user table there are multiple data which resides in different companies, function and subfunction. 

Now simple i want to give them access based on requirements so how can i achieve this ?


This is very specific to your apps needs BUT, generally you would have columns in your Users table for each condition you need to apply for permissioning.  For example you might have these columns in the Users table:

Company - The company the user belongs to

Allowed Functions - a list of the functions this user can access

Allowed SubFunctions - a list of the subfunctions this user can access.  Keeps the names unique - e.g. ABC Add, XYZ Add

*******

To use these user settings, I strongly recommend implementing the CurrentUser slice method described in the previous link provided.  It will greatly improve simplicity and efficiency of accessing the user settings.  Then you can do things like this:

IN("Function X", ANY(CurrentUser[Allowed Functions]))

...OR...

IN("SubFunction X", ANY(CurrentUser[Allowed SubFunctions]))

...OR...

AND(
    IN("Function Y", ANY(CurrentUser[Allowed Functions])),
    IN("SubFunction Z", ANY(CurrentUser[Allowed SubFunctions]))
)

 NOTE:  I don't recall if you can directly access list column by ANY(CurrentUser[list column]) like I have shown for the IN() function.  You may need to instead do... SPLIT(ANY(CurrentUser[list column]), ",").  A quick test will let you know

I hope this helps!

Top Labels in this Space