Drupal Organic Groups:自动使所有成员成为组管理员

发布于 2024-09-06 06:33:23 字数 163 浏览 4 评论 0原文

我正在使用 Drupal 6 构建一个以小组为中心的 Web 应用程序(使用 Organic Groups)。
所有组都是仅限邀请的,一旦用户成为该组的成员,我相信他拥有完整的组管理权限(例如邀请其他用户)。

关于如何将所有群组成员默认设置为群组管理员的任何想法。

干杯。

I'm using Drupal 6 to build a web application which will be centered around small groups (using Organic Groups).
All the groups are invite only, and once a user is a member of the group I trust him to have full groups admin rights (e.g. invite other users).

Any ideas on how I can set all group members to be group admins by default.

Cheers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

辞旧 2024-09-13 06:33:23

我找到的解决方案是在“用户插入”操作上实现 og 钩子,并使用 is_admin = 1 重写记录:

function supporttip_og($op, $gid, $uid, $args) {
  if($op == 'user insert') {
    $time = time();
    $subscription = array(
      'nid' => $gid,
      'uid' => $uid,
      'changed' => $time,
      'is_admin' => 1
    );
    drupal_write_record('og_uid', $subscription, array('nid', 'uid'));
  }
}

The solution I found is implementing the og hook on the operation 'user insert', and rewriting the record with is_admin = 1:

function supporttip_og($op, $gid, $uid, $args) {
  if($op == 'user insert') {
    $time = time();
    $subscription = array(
      'nid' => $gid,
      'uid' => $uid,
      'changed' => $time,
      'is_admin' => 1
    );
    drupal_write_record('og_uid', $subscription, array('nid', 'uid'));
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文