Ashok KS
Ashok KS

Reputation: 365

How restrict the view by members in drupal

I just create a view for showing all registered members profile details. But the problem is admin can see all Member details and also Members can see only their details. Now i want to restrict the view by, Admin can see all members and the Member can see their details itself.

How i do it ?

And also i want create a privilege, for example Admin can see all details, Managers can see some restricted data and the Members also have some restrictions.

Upvotes: 0

Views: 101

Answers (2)

Jukebox
Jukebox

Reputation: 1603

You can use hook_perm to create custom permissions.

<?php
  function mymodule_perm() {
    return array('View any members info', 'extra permissions ...');
  }
?>

Now you can set the View's access control to your custom permission.

Upvotes: 1

Matt
Matt

Reputation: 16

A couple of ideas:

If you use the content profile module, which creates a CCK content type for user information, you can use the content permissions built into CCK to restrict access to particular fields.

You could also in the view use a filter of "User:Current" which should filter the view to the current logged in user.

Upvotes: 0

Related Questions