# User Access

**URL:** https://forums.knack.com/t/user-access/19264
**Category:** Get Answers
**Created:** [April 30, 2025, 6:57am UTC](https://forums.knack.com/t/user-access/19264 "2025-04-30T06:57:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Keith6](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@Keith6](https://forums.knack.com/u/Keith6)
#### Post date: [April 30, 2025, 6:57am UTC](https://forums.knack.com/t/user-access/19264/1 "2025-04-30T06:57:26Z")

</div>

I have an app for a client which was built to allow all users access to all pages after the initial sign-in. The client now wants external users to access the system without the ability to update records. Is this just a case of limiting which users can access the update pages? Is there anything that I need to be aware of?

---

<div class="post-metadata">

### Author: ![LeighBerre96926](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/leighberre96926/32/4896_2.png) [@LeighBerre96926](https://forums.knack.com/u/LeighBerre96926)
#### Post date: [April 30, 2025, 8:35am UTC](https://forums.knack.com/t/user-access/19264/2 "2025-04-30T08:35:30Z")

</div>

In theory yes that it all you need to do … add a layer of login pages before all pages that can update. Then remove the primary login requirement.

But.

I recommend you copy your app and test it first to get the process right.

If you take this approach, then any link to those update pages will generate a login page, so that’s not ideal. Meaning you may need to put effort into hiding links and buttons that will cause this. Like for example duplicating a bunch of pages and removing all the update links.

And be aware that if you have any pages that filter views by logged in account they will no longer work once you take away the login requirement.

If those shortcomings are going to cause you grief then an alternative to consider is to create a simple shared login that you publish the details on the login page for the public to use …

Technically you could even add an extra button called “Public Login” to the login page with some JavaScript that auto-fills the login fiels with your shared login credentials and clicks the login button. Chatgpt can probably help you work out that process. I’m sure some javascript guru on here could probably assist too.

Doing that will of course then require you to introduce rules to discriminate between an authenticated company user versus a public user.

---

<div class="post-metadata">

### Author: ![Keith6](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@Keith6](https://forums.knack.com/u/Keith6)
#### Post date: [April 30, 2025, 8:43am UTC](https://forums.knack.com/t/user-access/19264/3 "2025-04-30T08:43:37Z")

</div>

Thanks Leigh for your response.

---

<div class="post-metadata">

### Author: ![LeighBerre96926](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/leighberre96926/32/4896_2.png) [@LeighBerre96926](https://forums.knack.com/u/LeighBerre96926)
#### Post date: [April 30, 2025, 8:45am UTC](https://forums.knack.com/t/user-access/19264/4 "2025-04-30T08:45:16Z")

</div>

I just edited it so you may wish to reread … a few more details …

---

<div class="post-metadata">

### Author: ![LeighBerre96926](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/leighberre96926/32/4896_2.png) [@LeighBerre96926](https://forums.knack.com/u/LeighBerre96926)
#### Post date: [April 30, 2025, 11:10am UTC](https://forums.knack.com/t/user-access/19264/5 "2025-04-30T11:10:07Z")

</div>

Keith

I had a play with adding a “Login as a Visitor” button to Knack login page. Simple. Just create a visitor account, and then update javascript with the view of your home login page, and the email and password of your visitor login, and its done. Will look something like this - adjust the instruction to suit …

 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/f/f83bb8668fd836638a9199a86936fdf8a923ac36.png)

Then change your app to use ROLES, and restrict the update pages to an EMPLOYEE role versus a VISITOR role. etc…

```auto
$(document).on('knack-view-render.view_16', function(event, view, data) {
  // HTML for instruction and visitor login button inside a styled box
  const visitorLoginHTML = `
    <div style="margin-top: 60px; padding: 20px; border: 2px solid #ccc; border-radius: 12px; background-color: #f9f9f9; text-align: center; max-width: 400px; margin-left: auto; margin-right: auto;">
      <p style="font-weight: bold; margin-bottom: 20px;">If you are a visitor, please click the button below to log in</p>
      <button id="visitor-login-button" style="background-color: #e60000; color: white; padding: 10px 20px; border: none; border-radius: 6px; font-size: 16px; cursor: pointer;">
        Log in as Visitor
      </button>
    </div>
  `;

  // Append the styled box to the login form
  $('#view_16 .kn-login-form').append(visitorLoginHTML);

  // Click handler to autofill and submit the form
  $('#visitor-login-button').on('click', function() {
    $('#email').val('visitor@company.com');
    $('#password').val('PASS1234!');
    $('#view_16 .kn-login-form form').submit();
  });
});

```

---

<div class="post-metadata">

### Author: ![Keith6](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@Keith6](https://forums.knack.com/u/Keith6)
#### Post date: [April 30, 2025, 5:21pm UTC](https://forums.knack.com/t/user-access/19264/6 "2025-04-30T17:21:13Z")

</div>

I’m not a coder so the thought of implementing this would worry me. In the end I remembered that @CarlHolmes created a video that used page rules to allow or disallow access to pages depending of the user role. I am now waiting on confirmation from my client that this is working as they requested. Thanks again for your input.

---

<div class="post-metadata">

### Author: ![CarlHolmes](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/carlholmes/32/2814_2.png) [@CarlHolmes](https://forums.knack.com/u/CarlHolmes)
#### Post date: [April 30, 2025, 6:29pm UTC](https://forums.knack.com/t/user-access/19264/7 "2025-04-30T18:29:12Z")

</div>

@Keith6 - I’m glad that one of my videos helped you find a potential solution 😎

---

<div class="post-metadata">

### Author: ![Keith6](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@Keith6](https://forums.knack.com/u/Keith6)
#### Post date: [April 30, 2025, 8:08pm UTC](https://forums.knack.com/t/user-access/19264/8 "2025-04-30T20:08:28Z")

</div>

I watch your videos not knowing if I will use whatever you are talking about or not just on the off chance. Looks like it paid off this time. Keep up with the videos.

---

<div class="post-metadata">

### Author: ![CarlHolmes](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/carlholmes/32/2814_2.png) [@CarlHolmes](https://forums.knack.com/u/CarlHolmes)
#### Post date: [April 30, 2025, 9:23pm UTC](https://forums.knack.com/t/user-access/19264/9 "2025-04-30T21:23:23Z")

</div>

@Keith6 - I appreciate your comment.

I do enjoy creating the videos, however, it’s often a challenge finding the time between work and home life 🧑‍💻

It’s good to know that in a small way I may be helping others. 🤩
