You don't have permission to access this page.

Hello I encountered this problem. When a member logs in to the website and go over to his/her profile when he/she is going to refresh the profile page it will show this message.

But when she/he clicks “Back to site”, It will just goes back to his/her profile.
NOTE: She/he was never logout.

I’m using google chrome browser and sometimes some of the elements will not load or display.

1 Like

I think it’s a bug? I tried removing my codes and refresh the page, still got the problem, sometimes it will just display directly the page profile.

I am facing the exact same issue. Anyone knows what to do with it?

Up. =x

When submitting a post, please make sure to follow these guidelines . Your code should be formatted and inside of a code block to make it easier to read.

When you use wix-location.to() for redirecting to a local page (that is, a page on your site), use this link pattern (as described the API):

/localPageURL: Another page on your site.

For example:

wixLocation.to("/mypage");

I’m sure your code is different than the original poster’s code. Therefore, you aren’t facing the “exact same issue”. You will have to provide more information for us to be able to help you.

Keep in mind…

The APIs in wix-users are only partially functional when previewing your site. View a published version of your site to see their complete functionality.

Hello Sir @yisrael-wix Im sorry, ill make sure to follow those guidelines next time. Going back to my problem, I removed the code wix-location.to(), I just use .hide and .show since i realized i don’t really need to refresh my page when inserting/updating new data in my case. So far I didn’t encounter the said problem above, but somehow i felt that wix loads too long and sometimes some of the elements will display super delayed.

Edited: I just found out that when a site member refresh the profile page for members only it will encounter the said error on my post above. :frowning:

I just found out that when a site member refresh the profile page which is a members only page, it will encounter the said error on my post above. :frowning:

When you use your live site you are still classed as Admin, however you are also classed as just a site member as well.

Therefore, as you have stated above the Wix Members app and the profile page that you have created separately as well, will all be site member specific.

Which means that only the actual user who is logged in will be able to view their own Members app pages and their own profile page that you have made up.

You won’t be able to view another site members personal page on your live site even though you are Admin.

Wow thank you for the explanation sir @givemeawhisky . Now that you mention it i realized they are all a site member once they log into a site. Is this come kind of a bug sir? I happen to encounter such problem often times i refresh my profile page. And also sometimes the textbox or other elements will not appear so i will refresh the page the it will be there again.

I am testing my site as well as a new member (not an admin) and this code is showing. The pages are restricted to “All members” but somehow, it shows.

Here is my code:

import wixData from ‘wix-data’;
import { local } from ‘wix-storage’;
import wixUsers from ‘wix-users’;
let counter = 0;
let sessionId;
let session;
var loginButtonValue;
var sessionIdValue;
var datepickerValue;
var timepickerValue;
var _idToDelete;
var contractValue;
var rateValue;
$w.onReady( function () {
getDetails();
loginButtonValue = local.getItem(“loginButton”);
console.log(“VALUE OF LOGINBUTTON VALUE: " + loginButtonValue);
datepickerValue = local.getItem(“datepickerValue”);
console.log(“VALUE OF DATEPICKER” + datepickerValue);
$w(‘#datePicker1’).value = new Date(datepickerValue);
timepickerValue = local.getItem(“timepickerValue”);
$w(‘#loginTP’).value = local.getItem(“timepickerValue”);
_idToDelete = local.getItem(”_idToDelete");
console.log(“REFRESH - ID TO DELETE: " + _idToDelete);
console.log(“ratevalue of refreshed is " + rateValue);
rateValue = local.getItem(“rateValue”);
$w(‘#rate’).value = rateValue;
contractValue = local.getItem(“contractChosen”);
$w(‘#currContract’).text = contractValue;
queryContract();
buttons();
});
function buttons() {
//SETS THE LOGIN BUTTON
if (loginButtonValue === “true”) {
$w(‘#login’).disable();
$w(‘#logout’).enable();
$w(‘#deleteButton’).enable();
} else if ($w(‘#currContract’).text === null || $w(‘#currContract’).text === “”) {
$w(‘#login’).disable();
} else {
$w(‘#login’).enable();
}
}
function queryContract() {
let userId = wixUsers.currentUser.id;
$w(”#contractDataset”).setFilter(wixData.filter()
.eq(“name”, userId)
);
}
function getDetails() {
let user = wixUsers.currentUser;
let userId = wixUsers.currentUser.id;
let isLoggedIn = user.loggedIn;
//Role for getting Name and ID Starts here. Getting Role at the .onReady function
wixData.query(“Members/PrivateMembersData”)
.eq(“_id”, userId)
.find()
.then((results) => {
let firstName = results.items[0].firstName;
$w(“#name”).text = “Hi, " + firstName + “!”;
$w(‘#freelancerName’).value = userId;
})
}
export async function login_dblClick(event) {
//CREATES THE SESSION ID
let user = wixUsers.currentUser;
if (sessionId === null || sessionId === undefined || sessionIdValue === null ) {
sessionId = Math.floor(((Math.random() * 10000000) * (Math.random() * 367824) * (Math.random() * 4831497))).toString();
}
//END OF CREATING SESSION ID
//CHECKS IF THE SUCCESS MESSAGE IS VISIBLE
if ($w(‘#successMessage’).hidden === false ) {
$w(‘#successMessage’).hide();
}
if ($w(‘#deletedMessage’).hidden === false ) {
$w(‘#deletedMessage’).hide();
}
//END OF CHECKING SUCCESS MESSAGE VISIBILITY
//GETS THE LOGIN DATE AND TIME and set it on the DISPLAY
let logIn = new Date();
$w(‘#datePicker1’).value = logIn;
let h = logIn.getHours();
if (h >= 0 && h <= 9) {
var hrs = “0” + h;
} else {
hrs = h;
}
let m = logIn.getMinutes();
if (m >= 0 && m <= 9) {
var min = “0” + m;
} else {
min = m;
}
$w(‘#loginTP’).value = String(hrs + “:” + min);
let forTimeHolder = $w(‘#loginTP’).value;
$w(‘#login’).disable();
$w(‘#logout’).enable();
//END OF DISPLAYING DATE AND TIME
const contractT = ( await $w(”#contractDataset").getItems(0, 20)).items;
const contractID = contractT[$w(“#contractName”).selectedIndex]._id;
rateValue = $w(‘#rate’).value;
//START OF CREATING DATA TO SUBMIT
var newSessionData = {
logIn: $w(‘#datePicker1’).value,
sessionId: sessionId,
userId: user.id,
name: user.id,
contract: contractID,
rate: rateValue
}
//END OF CREATING DATA TO SUBMIT
//ADDS A NEW DATA TO THE TIME SHEET
await wixData.insert(“timeSheet”, newSessionData).then(() => {
setInterval( async () => {
await wixData.update(“timeSheet”);
}, 1000);
})
//END OF ADDING NEW DATA
//SETS THE ITEM IN THE LOCAL STORAGE JUST IN CASE THE BROWSER IS CLOSED
local.setItem(“loginButton”, “true”);
local.setItem(“sessionIdValue”, sessionId);
local.setItem(“datepickerValue”, logIn);
local.setItem(“timepickerValue”, forTimeHolder);
local.setItem(“rateValue”, rateValue);
local.setItem(“contractChosen”, $w(‘#currContract’).text);
//END OF LOCAL STORAGE SETTER
//QUERYING THE NEWLY ADDED DATA AND GETS THE _ID
wixData.query(“timeSheet”).eq(“sessionId”, sessionId).find()
.then( async (result) => {
session = result.items[0];
_idToDelete = session._id;
console.log(“VALUE OF ID TO DELETE: " + _idToDelete);
local.setItem(”_idToDelete", _idToDelete);
})
. catch ((err) => {
let errorMsg = err;
});
//END OF QUERYING THE NEWLY ADDED DATA AND GETS THE _ID
//ENABLES THE DELETE BUTTON to Delete the NEWLY ADDED LOG IN DATA
$w(‘#deleteButton’).enable();
}
export async function logout_dblClick(event) {
//START OF GETTING THE USER
let user = wixUsers.currentUser;
//END OF GETTING THE USER
//START OF GETTING THE LOG OUT DATE AND TIME and displaying it.
let logOut = new Date();
$w(‘#datePicker2’).value = logOut;
let h = logOut.getHours();
if (h >= 0 && h <= 9) {
var hrs = “0” + h;
} else {
hrs = h;
}
let m = logOut.getMinutes();
if (m >= 0 && m <= 9) {
var min = “0” + m;
} else {
min = m;
}
$w(‘#logoutTP’).value = String(hrs + “:” + min);
//END OF GETTING THE LOG OUT DATE AND TIME and displaying it.
//START OF GETTING DATA TO UPDATE
var newSessionData = {
logOut: $w(‘#datePicker2’).value,
sessionId: sessionId,
userId: user.id,
name: user.id
}
//END OF DECLARATION
//GETS THE SEESION ID VALUE JUST IN CASE THE BROWSER IS CLOSED
sessionIdValue = local.getItem(“sessionIdValue”);
//QUERYING THE UPDATE THROUGH SESSION ID VALUE Which is the last value of the LOG IN SESSION ID
wixData.query(“timeSheet”).eq(“sessionId”, sessionIdValue).find()
.then( async (result) => {
session = result.items[0];
session.logOut = logOut;
await wixData.update(“timeSheet”, session);
$w(‘#successMessage’).show();
})
. catch ((err) => {
let errorMsg = err;
});
//RETURN THE VALUE OF THE ELEMENT TO STARING POSITION
setTimeout(() => {
$w(‘#datePicker1’).value = “”;
$w(‘#datePicker2’).value = “”;
$w(‘#loginTP’).value = “”;
$w(‘#logoutTP’).value = “”;
$w(‘#contractName’).value = “Select Contract”;
$w(‘#currContract’).text = “”;
$w(‘#rate’).value = “”;
$w(‘#deleteButton’).disable();
}, 1000);
//NULLIFIES THE sessionID to create a new one in LOG IN |
sessionId = null ;
local.removeItem(“contractChosen”);
local.clear();
//ENABLES THE LOGIN BUTTON AGAIN
$w(‘#logout’).disable();
}
export function deleteButton_dblClick(event) {
//remove the record from the collection
wixData.remove(“timeSheet”, _idToDelete)
.then((result) => {
//refresh the table with the updated info
console.log(“REMOVED”);
})
. catch ((err) => {
let errorMsg = err;
});
//CLEARS THE ITEM FROM THE LOCAL STORAGE
local.setItem(“loginButton”, “false”);
local.clear();
sessionId = null ;
//SETS THE BUTTON
$w(‘#login’).enable();
$w(‘#logout’).disable();
$w(‘#deleteButton’).disable();
$w(‘#deletedMessage’).show();
}
export function contractName_change(event) {
wixData.query(“contract”)
.eq(“contractTitle”, $w(‘#contractName’).value)
.find()
.then((results) => {
$w(‘#rate’).value = results.items[0].rate;
$w(‘#currContract’).text = "Current Contract: " + results.items[0].contractTitle;
//$w(‘#name’).text = results.items[0].name;
console.log(results.items);
})
. catch ((err) => {
let errorMsg = err;
});
if ($w(‘#currContract’).text === null || $w(‘#currContract’).text === “Current Contract: null”) {
$w(‘#login’).disable();
} else {
$w(‘#login’).enable();
}
}

Hi, Jefferson Uy .
I have been suffering from the same issue since January of this year.

If I remove all the custom code I get the same pattern “You don’t have permissions to access this page” on and off , and if I experiment with the untouched pure type wix site template with using a different Wix account I get the same pattern"You don’t have permissions to access this page".

I also asked a question here before and was told to consult Wix Support.
When I asked for verification of the problem over and over again, Wix Support was able to reproduce the problem, so Wix Support confirmed that the problem did exist. But no progress has been made yet…According to a report from Wix Support, the Corvid team is still trying to resolve the issue.It seems like a very difficult problem to solve even with a Corvid team.