Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 13 years ago

#1150 closed enhancement (fixed)

Allow site admins to restrict group creation

Reported by: simonwheatley's profile simonwheatley Owned by: cnorris23's profile cnorris23
Milestone: 1.5 Priority: major
Severity: Version:
Component: Groups Keywords: has-patch dev-feedback
Cc:

Description

I'm working on a site where we don't want to allow the creation of groups by everybody. Looking through the group creation functions it doesn't look possible to restrict the creation of groups through plugin currently, the hook-to-stop-group-creation.diff patch (attached) adds a hook to allow this to happen.

The restrict-group-creation.php plugin (attached) shows how a plugin might use this new hook, and some existing ones, to disallow group creation with a nice user message explaining why, remove the "create group" link, and post a message on the first step of the group creation form explaining to the user that they can't create a group. I did look into actually removing the form fields, but this didn't appear to be possible without further code additions, and the measures described above seemed sufficient.

Attachments (6)

hook-to-stop-group-creation.diff (1.9 KB) - added by simonwheatley 15 years ago.
Patch to add a hook allowing plugins to restrict group creation
restrict-group-creation.php (1.4 KB) - added by simonwheatley 15 years ago.
Plugin showing how the new hook might be used in a plugin which stops group creation
1150.001.diff (3.9 KB) - added by cnorris23 14 years ago.
1150.001.2.diff (3.9 KB) - added by cnorris23 13 years ago.
1150.002.diff (4.2 KB) - added by cnorris23 13 years ago.
Ignore 1150.001.2.diff. Uploaded wrong patch
1150.003.diff (4.1 KB) - added by cnorris23 13 years ago.
for 1.2 branch

Download all attachments as: .zip

Change History (16)

@simonwheatley
15 years ago

Patch to add a hook allowing plugins to restrict group creation

@simonwheatley
15 years ago

Plugin showing how the new hook might be used in a plugin which stops group creation

#1 @Jason_JM
15 years ago

  • Keywords needs-patch added; has-patch removed

Via IRC, Simon has agreed to re-write patch to allow the option for Admin to set whether a group can be created.

#2 @apeatling
15 years ago

  • Milestone changed from 1.2 to Future Release

#3 @cnorris23
15 years ago

  • Cc cnorris23+wordpress@… added

#4 @cnorris23
14 years ago

  • Component set to Groups
  • Keywords has-patch added; groups needs-patch removed

An updated patch for current trunk.

@cnorris23
14 years ago

#5 @cnorris23
13 years ago

  • Keywords dev-feedback added

Refresh/update patch

@cnorris23
13 years ago

Ignore 1150.001.2.diff. Uploaded wrong patch

#6 @cnorris23
13 years ago

  • Cc cnorris23+wordpress@… removed
  • Summary changed from Hook to allow plugins to prevent group creation to Allow site admins to restrict group creation

@cnorris23
13 years ago

for 1.2 branch

#7 @cnorris23
13 years ago

Adding patch for 1.2 branch. I haven't tested this version yet, but I don't think there should be an issue. All of my 1.2 test installs have been upgraded.

#8 @cnorris23
13 years ago

  • Owner set to cnorris23
  • Status changed from new to assigned

#9 @DJPaul
13 years ago

  • Milestone changed from Future Release to 1.3

#10 @boonebgorges
13 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [4338]) Adds admin switch to allow group creation to be restricted to Super Admins only. Fixes #1150. Props cnorris23

Note: See TracTickets for help on using tickets.