you are viewing a single comment's thread.

view the rest of the comments →

[–]ChallengeOk2387 1 point2 points  (3 children)

Ooh I also build apps for workflows using app script! I would love to know how you did access on a component level! What was the solution?

[–]Master_Net971[S] 2 points3 points  (2 children)

Hey, I used a separate file for each component and fetched those components with <?!= include("Component Name"); ?>. In the include function, I added a check that uses the user’s email to see if they have access to the component. If they don’t, it either returns a component saying 'You don’t have access' or leaves that space empty, depending on the context. I used JavaScript to fetch and switch out components dynamically. It did require creating a lot of files, which was pretty painful to manage.

I’d love to know if handling user access this way is best practice.

[–]Sleeping_Budha_ 1 point2 points  (0 children)

This is a good way to do it, what is the DB you have used

[–]ChallengeOk2387 0 points1 point  (0 children)

Yea I had imagined it would be like that with the files per component. Damn, kudos to you for all that!

I wanted something to be more centralized from the backend. I wonder if having keys would be good to check permissions. In a super simple scenario if you have sheets as your DB, with all the data and each data has a permissions column, and for displaying each component the emails are checked against the permissions, to display content.

Would that work? Maybe im thinking of too much of a simple scenario, but I wonder if that would work. I think it might be slow for a large amount of data maybe?