Jump to content
Guy Incognito

Front end editing without backend access?

Recommended Posts

As per the title really, is it possible to set up front end editing permission on a template without granting a user access to the back end dashboard?

I know I can allow editing with the API but seems to be reinventing the wheel somewhat!

Share this post


Link to post
Share on other sites

I think it should be enough to put this in your /site/templates/admin.php

if(!$user->isSuperuser()) $session->redirect('/');

 

  • Thanks 1

Share this post


Link to post
Share on other sites
1 minute ago, bernhard said:

I think it should be enough to put this in your /site/templates/admin.php


if(!$user->isSuperuser()) $session->redirect('/');

 

A beautifully simple approach thank you! 🙂

Share this post


Link to post
Share on other sites

Actually this would also prevent you from opening the login-screen. But you get the idea and can modify it to your needs (like checking for a user role or a page template or id etc.).

Share this post


Link to post
Share on other sites
1 minute ago, bernhard said:

Actually this would also prevent you from opening the login-screen. But you get the idea and can modify it to your needs (like checking for a user role or a page template or id etc.).

Yes sure I can make something work here thanks. Love these kind of simple approaches - I was way overthinking it!

  • Like 1

Share this post


Link to post
Share on other sites

Wouldn't it also break complex fields frontend editing, which happens in popup iframes with admin pages loaded?

Share this post


Link to post
Share on other sites
9 hours ago, Ivan Gretsky said:

Wouldn't it also break complex fields frontend editing, which happens in popup iframes with admin pages loaded?

I think so, yes. But it should be quite easy to whitelist some pages/templates/roles and only redirect all other requests 🙂 

Share this post


Link to post
Share on other sites
11 hours ago, Ivan Gretsky said:

Wouldn't it also break complex fields frontend editing, which happens in popup iframes with admin pages loaded?

Interesting I hadn't considered that.

I was wondering - could I just change the admin template permissions in the access tab to exclude the roles I don't want to give backend access to? Any unforeseen consequences here? 🤔

 

Share this post


Link to post
Share on other sites
39 minutes ago, Guy Incognito said:

I was wondering - could I just change the admin template permissions in the access tab to exclude the roles I don't want to give backend access to? Any unforeseen consequences here? 🤔

I think that would have the same effect of breaking frontend editing modals. But you can easily allow modals via checking if $input->get->modal == true (note double == not triple, because modal can be 1 or panel or modal)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By neonwired
      I have a front end form for creating new pages, repeater and repeater matrix field don't seem to save any data. I was considering handling the data manually but can't seem to get anything useful from the post data, are there any methods i can use?
    • By VeiJari
      Hello forum,
      This is really a weird one, because front end editing works in a earlier website we did to a customer. 
      When I check the source code for current website it does initiate front end edit: 
      <span id=pw-edit-1 class='pw-edit pw-edit-InputfieldPageTitle' data-name=title data-page=1021 data-lang='1017' style='position:relative'><span class=pw-edit-orig>Tekijät</span><span class=pw-edit-copy id=pw-editor-title-1021 style='display:none;-webkit-user-select:text;user- select:text;' contenteditable>Tekijät</span></span>  But when I double click nothing happens (yes I'm 100% sure I'm superuser and logged in)
      I also tried to apply the front end with other methods than:
      $page->edit('title'); But didn't work either.
      We are using jquery 2.2.4, so it should not be a problem.
      Is this a bug related to current master or something else?
      Someone else having this problem as well?
    • By NoremPload
      i love the new  Front-End Page Editor, but as always there are some troubles with good old apple ;(
      i have a text field, a text-area field an an image with activated front end editing. everything works fine on desktop, on android and on older iOS devices.
      But with iOS10 apple ignores user-scalable=no, so if i doubletap on the edit region, the text zooms. it works on the image but not on the text. 
      any ideas to make it work again ?
       
      thx !
    • By quickjeff
      Hi Guys,
      Im at a point in my project where I have front end user registration, login capabilities and posting of page capabilities by registered users. The users can also edit their own page. Its pretty much a clean site that is made to function like Craigs list but look like a personal ad site. I have used ryans method for registration, profile control and login. All is good so far! Now in profile template which I call their account management page, a user sees all their pages they have posted. The user can click the link to their page to front end edit their pages content. I would like to also give them ability to unpublish, republish or delete their page. Any thoughts or ideas? The way I invision it, a script checks to see if the user has access to edit the page, which I have done. Then the user can edit via fedI front end editor module. Now I need to display a button unpublish, a button to republish and a button to delete.
      Any guidance is appreciated.
×
×
  • Create New...