fictionco / fiction

(Join Waiting List) Personal Marketing Platform. A powerful platform for your online identity.

Home Page:https://www.fiction.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Post Type Access Level

mohitsehgal opened this issue · comments

I added custom post type successfully and added {accessLevel: 20} in addPostType.
Then I signed up with new user. Verified its email.
Case 1
Result - I was not able to see my custom post type in dashboard. ( New user had accessLevel 20 and role creator)

Case 2
I changed the accessLevel of the user from MongoDB to 50, and logged out and again logged in
Result - I was not able to see my custom post type in dashboard

Case 3
I changed the accessLevel of this user from MongoDB to 100, and logged out and again logged in.
Result - I was able to see my custom post type in the dashboard along with several others.

What did I conclude?
accessLevel parameter is not getting used in the code to determine which post types are shown on the dashboard. Instead, it is hardcoded to 100.

Revision
@factor/dashboard/menu.ts Line 73
factor/@factor/dashboard/menu.ts

Line 73 in cc86667

if (userCan({ accessLevel: 100 })) {

Hardcoded accessLevel:100 for the dashboard menu.