Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
6af81f07
Commit
6af81f07
authored
Jul 16, 2010
by
Richard Mansfield
Browse files
Allow non-staff users to become admin of course group (bug #603044)
Signed-off-by:
Richard Mansfield
<
richardm@catalyst.net.nz
>
parent
2dbd0e3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/grouptype/lib.php
View file @
6af81f07
...
...
@@ -84,6 +84,13 @@ abstract class GroupType {
public
static
function
can_be_created_by_user
()
{
return
true
;
}
/**
* Returns whether a user can be promoted to admin of a group of this
* grouptype (by an existing group admin, on the 'change role' page)
*/
public
static
function
can_become_admin
(
$userid
)
{
return
true
;
}
/**
* Returns the roles this group type implements
...
...
htdocs/lib/group.php
View file @
6af81f07
...
...
@@ -109,10 +109,8 @@ function group_can_change_role($groupid, $userid, $role) {
// admin role permissions check
if
(
$role
==
'admin'
)
{
$group
=
group_current_group
();
$user
=
new
User
();
$user
->
find_by_id
(
$userid
);
safe_require
(
'grouptype'
,
$group
->
grouptype
);
return
in_array
(
$group
->
jointype
,
call_static_method
(
'GroupType'
.
$group
->
grouptype
,
'
user_allowed_join_types
'
,
$user
)
);
return
call_static_method
(
'GroupType'
.
$group
->
grouptype
,
'
can_become_admin
'
,
$user
id
);
}
return
true
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment