0

I am working on a website where there will be users publishing contents.

How can I restrict users from accessing other users' contents and only able to view, edit or delete their own contents?

  • "users publishing contents" and "only able to view their own contents" is contradictory, since publishing typically means "let everyone see". What exactly do you mean? – Kari Kääriäinen Mar 17 '14 at 3:34
1

You can set these permissions at People > Permissions. Take a look at the 'Node' section. Also, a very practical module for specific cases is Field Permissions.

The Field Permissions module allows site administrators to set field-level permissions to edit, view and create fields on any entity.

1

You can use Node Access Rules module.This module control the access to a certain node or node group by Rules. It allows you to control the access to a node (create/view/edit/delete) by Rules.

1

What you're talking about is Drupal node access control.

The core's built-in support for node access control is rather course, in particular when it comes to viewing content. If your specific requirement is that user shall only be able only be able to view, edit or delete his/her own contents, the simplest solution is to not publish the content.

You do this by setting the the default state for a new node to unpublished. Navigate to Administration » Structure » Content types, and then pick the content type. Under Publishing options you untick the option Published. Then, to allow user to see his/her own content, navigate to Administration » People » Permissions and tick the permission View own unpublished content for the authenticated user. To allow the user to edit and delete his/her own contect rick the persmissions Create new content, Editit own content, Delete own content for all the content types you want your users to be able to use.

The above solution is for Drupal 7 and can be realized with the functionality in core alone.

If you for some reason can not use the solution outlined above, you must use some sort of node access control module to control the access to view the node (create new, and edit/delete own can still be controlled by means of core user permissions). There is a page at Drupal.org listing all node access modules, with a capsule review of each. I suggest you take a look at that page to see if you can find a suitable module.

  • Thank you very much for the help it is working. I was wondering if there is any way I can show list of their own content with option to delete or edit. Thank you very much for the help. – Yama Apr 8 '14 at 16:05
0

After few days of research I finally find an easy way to manage users control over their own content.

  • Step 1:

    Visit http://drupal.org/project/workspace to download the latest version of "Workspace".

    • Step 2:

    Extract the files into a folders on your desktop. The folder will be called "workspace".

    • Step 3:

    Login to your site's files via FTP and navigate to /sites/all/. If there isn't a folder called /modules/ here, create one.

    • Step 4:

    Upload the "workspace" folder to /sites/all/modules/

    • Step 5:

    Go to Administer >> Site building >> Modules and enable Workspace. You'll need to check only one box.

    • Step 6:

    When your users login they'll see a link in the admin menu called "My Workspace". When they click on it they'll see a screen like this:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.