I am just wondering if you have plans to create a Drupal 7 version of this module. I think it would be awesome to have in Drupal 7.

CommentFileSizeAuthor
#16 view_own_drupal7patch_1028560_16.patch14.76 KBfrjo

Comments

lpalgarvio’s picture

+1

waxb’s picture

+1

sw3b’s picture

Subscribe

thomas4019’s picture

+1

FrequenceBanane’s picture

subscribe

nhytros’s picture

I'm working to porting view_own to Drupal7.
Need to porting this function

/**
 * Implementation of hook_perm().
 *
 * Add view own and view any permissions for all content types
 */

function view_own_perm() {
  foreach (node_get_types() as $type) {
    if ($type->module == 'node') {
      $perms[] = 'view own '. $type->type .' content';
      $perms[] = 'view any '. $type->type .' content';
    }
  }
  return $perms;
}

can someone help me to port this function?

JohnnyX’s picture

Subscribe

marblegravy’s picture

You can try Workbench Moderation for similar functionality. -> http://drupal.org/project/workbench_moderation

(that is, Workbench Moderation will let you see a list of your own content only or create content that only the authors can see while they're working on the draft version...) for access restriction, try Workbench Access -> http://drupal.org/project/workbench_access

both very good, mature modules.

jordojuice’s picture

@nhytros, hook_perm() has changed to hook_permission() in D7. Here are the docs http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
This particular implementation could be changed to.

/*
 * Implements hook_permission().
 */
function view_own_permission() {
  $perms = array();
  foreach (node_type_get_types() as $type) {
    if ($type->module == 'node') {
      $perms['view own ' . $type->type . ' content'] = array(
        'label' => t('View own %type content', array('%type' => $type->type)),
        'description' => t('Some description.'),
      );
      $perms['view any ' . $type->type . ' content'] = array(
        'label' => t('View any %type content', array('%type' => $type->type)),
        'description' => t('Some description.'),
      );
    }
  }
  return $perms;
}

Something to that affect. I wrote that on an iPad so bare with me, because writing code on an iPad is very difficult! I'd be glad to help more with the port when I have time, which is quite often thankfully.

basicmagic.net’s picture

subscribe

muhh’s picture

I really need exactly this functionality, so i will upgrade this to Drupal 7.

Since i didn´t have a look yet, is there anything else todo except for #9?

karolacello’s picture

any news?

johnv’s picture

This module has not been maintained for 2 years. And apparently no-one else thinks it is important enaough to port this module.
Try http://drupal.org/project/nodetype_access instead. Does that fit the needs?

JohnnyX’s picture

Is it possible to build a "view own" (and "view any")? permission for nodes?
I don't need it any more, but "view own" permissions should be useful...

JohnnyX’s picture

frjo’s picture

Title: Drupal 7 version? » Drupal 7 patch
Version: 6.x-1.1 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new14.76 KB

Here is a patch to upgrade the view own module to Drupal 7. Had a need for it in a project and this is the code that we run there. It's only tested for that specific use case but I believe there are now major bugs.

smartsystems160’s picture

Issue summary: View changes

Node view permissions perfectly replaces this module for drupal 7