A long time ago, I posted a similar issue with Alpha 7 here:

http://drupal.org/node/1029782

I had been using Alpha 10 or 11 with no issues for some time, and after letting my site lay dormant for a few months, I recently started up development again, and upgraded to beta 16. Doing this has brought back the "Access denied" message when a non-admin user tries to post a job listing node. There are a few strange issues happening here:

1. When the user submits a job node, they receive the "Access denied" message after the node is saved.
2. The node is created, and in the administration menu appears as published. Nevertheless, it will not show up in views for the authenticated user. Admins can see the nodes in views fine, but authenticated users cannot. Attempting to access the node directly via the url will also result in an access denied error message for authenticated users.
3. This does not appear when listing or job listing themselves are enabled. Only when the job application module is enabled. Nodes created when the job application module is disabled are plainly visible to authenticated users. However, even with the job application node enabled, nodes created by admins are readily visible to authenticated users, and authenticated users are able to apply for jobs without incident.
4. Nodes created on non-job-listing content types have no issues to speak of.

Quite a strange issue here. Seems like nodes created by authenticated users are getting stuck halfway between unpublished and published, and that is resulting in their invisibility to average users and the access denied page. Any idea what could cause this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NewZeal’s picture

Maybe you have some crazy node_access module in operation. Try rebuilding permissions. If that doesn't fix it, then look for any modules that control access and disable them while you see if the job creation and application process works. Also check that you have selected a resume content type which is not the job type or job application type.

NathanM’s picture

I did have content access enabled, as well as OG Content Type permissions. Disabling it and rebuilding permissions didn't fix anything, though. Neither did uninstalling and re-installing the Listings module. Really stumped here.

NewZeal’s picture

I cannot help any further without looking at your specific site setup.

NathanM’s picture

Well, it seems that completely uninstalling the module, deleting all the files, database tables and node types, and re-installing again has gotten it working. Sucks to have to rebuild my content types, but I'll live. Something in the Listing database must have gotten screwed up while upgrading from such early versions.

NathanM’s picture

Check that. Once a job has been applied for, the problem rears its head again. The owner of the job is able to see the job node just fine, but other users are receiving the "access denied" page when they try to access the node content. I'm guessing that this is somewhat related to the embedding of the applications view into the job node. Are there any permissions settings that are supposed to go along with this?

NewZeal’s picture

The problem is likely the result of something else in your configuration. As previously stated, I can only deal with this by looking at your installation.

masakmaeda’s picture

I just ran into the same problem; and additionally, when I tried to remove an account I got this error:
Not Found
The requested URL /admin/people was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I am new to all this and have to problem allowing you to have a look at my installation.

thanks

NewZeal’s picture

Contact me via my contact form and I'll sort it out with you.

NathanM’s picture

NathanM’s picture

FileSize
23.49 KB

I emailed you proper details now using the contact form. Since that time, I've noticed something strange that may be affecting things. Looking in the database tables, it appears as though there are 6 entries under listing_jobappln, but only two under content_type_jobappln, (see attached listing_jobappln table settings). I had deleted several job_appln and jobposting nodes through the drupal content interface earlier, and it seems as if those nodes are being at least partially referenced by the listing_jobappln tables. Not sure if that is intended or not, but it seems a bit strange.

NewZeal’s picture

FileSize
5.06 KB

Ok, I found a bug. Try the attached version of the module. And in the next comment a small change to listing_job.

NewZeal’s picture

FileSize
4.29 KB

Also small change to listing_job, attached.

NathanM’s picture

Still getting these access denied errors. There are the ones I can see for sure:

Authenticated users:
Receive an "Access Denied" message when creating a job node. The node itself is created and listed as published, but authenticated users can't access it, and can't see it appearing in views.

Admin users:
Can create job listings without problems, which are viewable to authenticated users. They are also able to see and access job nodes created by authenticated users, (even though these aren't visible to the authenticated users themselves). There are no additional permissions that should be in place for viewing job nodes.

Admin users can also apply for the authenticated user's jobs, and job applications are being created. However, the authenticated user will see the job application but not which node it is applied for, and trying to access all applications on job nodes they created, (the view link to applications/[nid]). also brings up an Access denied error. If a user applies to an admin-created job, there are also fields missing like in the applicant & job name.

Both authenticated users and admin users:
Are able to create resume content without problems. However they are only able to see their own resume content. When they try to access others resume content, they get an "access denied" error.

The "jobs I've applied to" view no longer seems to be working. Even though these applications are being created, nothing shows up in this view.

NathanM’s picture

I went and created another drupal install to test this, and I'm still running into these problems on the new install. One strange thing I noticed is that the "job" content type is automatically created when installing the job listing module, along with "job_appln" and "resume". However, unlike job_appln and resume, the "job"content type cannot be deleted through the content types, and has no basic node permissions in the permissions section. Could the automatic creation of this content type somehow be messing with permissions? I wasn't even using the "job" content type previously, rather was using a different content type called "jobposting". However, one this new install, I had the same results whether I was using "job" or "jobposting".

NewZeal’s picture

Nathan, can you contact me via the contact form again. Last time you emailed me and I went to the site, it was broken completely and I couldn't do anything.

Thanks.

NathanM’s picture

Sent.

NewZeal’s picture

Status: Active » Fixed

Access denied in this case was caused by the existence of two node access modules: content access and content permissions. Simply running rebuild permissions resolved this issue.

NathanM’s picture

I disabled the following modules:
ACL
Content Access
Content Permissions
Question/Answer, (Because it depends on content permissions)
Custom Publishing Options
Override Node Options
Node Limit Number

Rebuilt permissions, and cleared my caches, and I'm still getting these errors. Every time I rebuild content access permissions, I'm able to access it, but posting new nodes triggers the Access Denied message again. I don't think it is directly tied to any permissions module.

NathanM’s picture

I found out that the problem seems to be getting caused by this permission in job_appln:
listing_jobappln module: View all job applications

I noticed that I was getting access denied for authenticated users when submitting a job, even when using the "Preview" option. I then logged in and tried to create a job using an admin user, clicked the preview, and noticed that it was showing all job applications for all jobs on the embedded jobs_appln view, (see the screenshot below). When I added the "View all job applications" permission to authenticated users, they were then able to create job listings without issue. However, there seems to be a security issue in that applications for other jobs can still be viewed through the preview screen, and something about how that view operates when the job is not yet published is causing these errors. Let me know if there is anything I can do to either to fix this issue, or to prevent that view from being embedded in the job nodes, as this has caused issues in the past for me, and given that I am displaying applications on a separate page, it isn't really needed here.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

NathanM’s picture

Status: Closed (fixed) » Active
NewZeal’s picture

Version: 6.x-1.0-beta16 » 6.x-1.0-rc3
Category: support » bug

This certainly seems to be a bug. I'm sorry, I just haven't had the time to look at this. I hope to launch a job site soon which will mean closer attention to job module bugs. Best if we leave this open.

kristat’s picture

I am using the listing module rc3. I am receiving access denied problems in 2 very critical place. Running cron and accessing the logged in user account. Turning off everything but listing, job listing, and job application seems to fix the cron problem. This is ashame because I wanted to use the location search stuff. But I suppose thta can be built up with the locations module I suppose. But the one I can not get around or figure out is accessing the logged in users account page. If I turn off the listing module I can access the user account page for all roles. But when the isting, job listing, and job application modules are on, all users of specific roles are denied access to their own user account page. I have tried to change the permissions, add the working roles to the not working user, reinstalled the module, tried the dev module. All to no avail. there are several other access denied problems I have run into, but these are the most pressing.

NathanM’s picture

The user account page issue sounds like it is related to the "My Listings" tab on the user account page, which also may be tied to the issues I outlined above, (items being created with conflicting permissions due to the embedded view). You could try something like Tab Tamer to see if disabling the "My listings" tab would fix anything.

NathanM’s picture

I believe I was able to hide the "Job Applications" view on the node page which was causing conflicts, and authenticated users are now able to post jobs. What I did was set the view permissions to only show if user has the "View All Job Applications" permission. Now if I could just figure out how to disable the part of the module that is denying access to the resumes.

NewZeal’s picture

Status: Active » Needs review

I have altered the job application module, so that instead of giving access denied on the view, it simply unsets the view, so nothing displays. This will stop access denied errors for users on jobs.

I have also altered all node views where I have used a drupal_goto or access_denied to detect for a cron run. This should prevent cron from breaking.

I wanted to create the application module with permissions for resumes built in and avoid having to use a node_access module and I'd like to keep it that way.

Please test the new release and come back to me with any feedback.

kristat’s picture

Thanks for the info, the tab tamer module is quite useful, but did not solve the problem. thanks again

redaccion’s picture

Version: 6.x-1.0-rc3 » 6.x-1.0-rc4
Priority: Normal » Critical

I have the same issue...

1- Only owner can access to Resume, even admin can't access, so...
2- Cron broke when another user (non admin) create resumes... if I delete the other resumes, cron run...

I've disabled all the other modules and the issue is there...

I've tryed a work around, setting in JobApplications View:
1- Acces by role
2- Acces by permission (access content)

and nop... still have access denied to non owners in Resumes content type...

redaccion’s picture

I forgot to say that the problem is not present when the node is in edit mode... the resume can be edited perfectly by users with properly permissions...

redaccion’s picture

if this help, I've this msg in the drupal log

Cannot modify header information - headers already sent by (output started at /.../includes/common.inc:424) in /.../includes/common.inc on line 350.

and nothing in apache's log...

kristat’s picture

I am also still having issue with cron run and access denied. If I disable the job application module run cron and re-enable the module cron will run. But as soon as someone actually applies for a job, cron receives access denied errors and stops running. Disabling and re-enabling the module seems to solve the problem. But it is not something that should have to be done. Hopefully this helps to track down some of these issues

redaccion’s picture

I think this is my problem (I don't know if is the same than yours kristat

in file "listing/listing_job/listing_jobappln/listing_jobappln.module" line 166

//  Resumes should only be viewable by the author
	  if ($node->type == variable_get('listing_job_resume_type', 'resume') && $node->uid != $user->uid) {
	    drupal_access_denied();
		drupal_goto('');

I comment these lines and everyone can see the resumes... I think this probable let run your cron... I'll try aplicating for jobs...

redaccion’s picture

yes... this works fine for me... I think that I can manage the access with other modules...

Great work New Zeal... very, very, very much thanks¡¡¡

NathanM’s picture

While I understand New Zeal for wanting to keep things as simple as possible, having the ability for admins to access resumes is very important, (not to mention other possible applications). Not to mention that interfering with drupal permissions seems to be causing a lot of problems. Thanks to both New Zeal and redaccion for fixing all of these issues.

NathanM’s picture

New Zeal, I'm still getting access denied on node/add for authenticated users. Adding the "View all job applications permission" allows authenticated users to post, again. Thought I had it licked, but after upgrading to RC4 the error is still there. Commenting out the lines in #32 fixes that issue, however.

NathanM’s picture

I was able to get the "Access Denied" errors to stop appearing on the node/add/job form by commenting out the view from listing_jobappln.module:

// When we view a node we show applications made to selected users
if (in_array($node->type, variable_get('listing_job_ctypes', array())) && ($user->uid == $node->uid || $user->uid == 1 || user_access('View all job applications'))) {
$node->content['body']['#value'] .= views_embed_view('JobApplications', 'block_1', $node->nid);
}

This is listed right above the code redaccion posted about before.

Given the amount of issues this view can cause, it would be better just to remove it from the node itself, and instead just use node panel templates to show the view. That has the added benefit of allowing users to better style the placement of that view. Just a thought.

NathanM’s picture

Another "Access Denied" issue. Users without the "View all job applications" permission are not able to view applications to their own job. It will result in an Access Denied error. However, granting them that permission gives them the ability to view everyone else's applications as well, if they know or can guess the application ID. Seems like there should be a separate "View applications for jobs posted by user" permission.

NewZeal’s picture

I am doing a job site this week and will change this feature based on the feedback from this thread so that users can be given permissions to view resumes based on their roles.