| 1 |
<?php |
<?php |
| 2 |
// $Id: og_vocab.module,v 1.18.2.18 2009/01/23 09:56:17 amitaibu Exp $ |
// $Id: og_vocab.module,v 1.18.2.21 2009/05/05 12:13:02 amitaibu Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 493 |
* Access function to determine if a user has access to the menu item. |
* Access function to determine if a user has access to the menu item. |
| 494 |
*/ |
*/ |
| 495 |
function og_vocab_determine_access($node, $perm) { |
function og_vocab_determine_access($node, $perm) { |
| 496 |
return og_is_group_type($node->type) && og_is_group_member($node->nid) && (user_access($perm) || user_access('administer organic groups')); |
// Group admin should have access regardless of permissions. |
| 497 |
|
// Otherwise check the user is a member with the right permissions. |
| 498 |
|
return (og_is_group_type($node->type) && (og_is_group_admin($node) || (og_is_group_member($node->nid) && (user_access($perm) || user_access('administer organic groups'))))); |
| 499 |
} |
} |
| 500 |
|
|
| 501 |
|
|