-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to authenticate custom admin pages and controllers using refinerycms-authentication-devise #28
Comments
@bricesanchez Any update Sir? I need your help to get through this please. Thanks.! |
@parndt could you help us? |
# in your controller
before_action :authenticate_refinery_user! |
I added:
Now, I am having these issues:
and full trace is:
|
You need to include the BaseController module inside your controller to use its functionality. |
My code now look like this:
And it says:
full trace is:
if i comment If I try with below code in application controller:
it returns me the errors below.
|
|
I've been trying to update the Sadly, I'm not competent to really delve into this issue. Do you have any pointers, @parndt ? This issue seems related as well: https://stackoverflow.com/questions/36921220/refinerycms-admin-tried-to-access-refinery-admin-accommodations-but-was-reje This is what I'm getting:
|
it seems like it's failing at the engine permissions level: https://github.com/refinery/refinerycms/blob/e49a6bebefe34bedcca932887f1446f084a23c33/core/lib/refinery/admin/base_controller.rb#L55-L60 refinerycms-authentication-devise/lib/refinery/authentication/devise/authorisation_adapter.rb Lines 18 to 31 in 125ec0a
so we can see in the last link that for this particular message, it's because your user doesn't appear to have access to your plugin, which is inside the controlled by this line refinerycms-authentication-devise/lib/refinery/authentication/devise/authorisation_adapter.rb Line 23 in 125ec0a
refinerycms-authentication-devise/lib/refinery/authentication/devise/authorisation_adapter.rb Lines 25 to 27 in 125ec0a
|
Are there any special installation steps for the plugin @evenreven ? I can try this later on if I get a chance! |
However... it seems like you just need to set a plugin.menu_match = %r{refinery/page(_part|s_dialog)?s(/preview)?$} |
Thanks for the quick response! The installation is done with a generator. The steps are in the readme of the forked repo I linked to above. I just had to edit the migration with my Rails version (in my case put I will take a look at your suggestion in a few hours when I'm back at the computer. |
Oh, I think I see now! I'll try to put the relevant regex in the engine.rb instead. Does this mean that my other changes were pointless? A general comment: the dynamic fields extension seems really useful. I've needed some pages and view templates to have extra fields, but I've held back because I don't want extra fields on every page, and additional page parts are rarely the right approach for us. (Also, different page/content types have their own challenges with routing etc., for me regular pages using different view templates is most often the best approach.) |
Thanks for the pointer. I tried this and even though I still get a 404 and nothing changed when I click the tab inside Refinery, these lines are now gone from the rails s output:
So something happened, but it still 404s. EDIT: Oh, and to answer an obvious question you might have, I've given my user permissions (inside the user tab) to use the Dynamicfields component. :) |
Good to see someone is using that extension. I have been thinking of trying it too, but didn't know how well it would work with Refinery 4. |
Well, to say I'm using it is pushing it, considering my fork doesn't work yet. ;) Any pointers beyond what @parndt suggested would be great! (BTW, I noticed in old pull requests that @bricesanchez did some work on the Refinery 3-compatible version.) |
I tend to have the same problem every now and then, and I find it hard to remember what the fix is. iirc, the problem is with the I will have a look back over some recent commits. I would also look at the routes and make sure that the route matches. Here is a fragment of one that is working
good luck. |
Haven't looked at routes at all. Good tip, thanks! |
Couldn't get that to work either, sadly. Giving up for now (unless some competent dev has the time to look at it). |
@evenreven please look here jfalameda/refinerycms-dynamicfields#13 You can try to bundle project with my fork (https://github.com/radek2r/refinerycms-dynamicfields) and check if it resolves your problem |
Thanks! One step closer. Now I can see the add field GUI without getting a 404. But I still can't find the newly added field anywhere in the page editing window. There's some HTML with |
Shall I leave this issue open? |
Hi,
I have installed refinery cms and need to add custom controller, currently I have added all my controllers and they are working fine as well.
Basically, its admin controller that is other than refinery controllers whom I wants to authenticate if user is not logged in.
so, if no user is logged into the site, it will redirect it to refinery/login page.
I have admin controller whose code is like:
My gem file:
Some page code:
And my link is something like:
http://localhost:3000/admin/teachers/new
. These links are of in great number so I wants to authenticate all of them. So, if user try to access these pages by putting URL in browser, so it will redirect user to login page.Simply, what I need to do is if some one directly access
http://localhost:3000/admin/teachers/new
page, he should redirected to refinery/login page.For all other controllers or pages the behavior is working fine but I want to fix it for these custom pages now.
I have tried loads of codes and things regarding device or refinery authentications but all in vain.
Here is my reference question on google group as well:
https://groups.google.com/forum/#!topic/refinery-cms/yQ_OWIKxLdY
The text was updated successfully, but these errors were encountered: