Assign BLOG writer permission from code

Hi all,

when users become site members I want to assign to them WRITER PERMISSION on my site’s blog automatically. Is there a way of doing that from code?

In alternative, I’d like to create a form so they can create a blog post without giving them access to my dashboard.

Thanks!

Of course your wished function should be possible to be done by code.

So first question you should think about is…

1) What does it mean → ? BLOG writer permission ?
Yes, of course it means, that a user either can create posts or not, depending on the permission. For sure all posts will be collected inside a database.

So we know the question and we know the answer, the one thing we don’t know is how to transfer/convert this into code, right ?!?

  1. What do we need now?
    We will surely need some kind of ROLE/BADGE-SYSTEM, which would recognize the level/role/badge of the user.

Let’s say USER-A has level-3 and USER-B has level-1.

level-1 = Badge-X
level3 = Badge-Y

The flow:

  1. User logs in
  2. System checks the user for his BADGES
  3. If right BADGE available —> open page or lightbox, or do what ever you want…
  4. If no related USER-BADGE found → nothing happens → access-denied → you can’t create posts.

The same you could do by using ROLES.

Some keywords…
-passowrd-protected-pages
-badges & roles
-wix-members-app
-wix-blog-backend
-Wix API-DOCS

Thanks for the detailed answer, it was interesting to know about it!