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
55b99655
Commit
55b99655
authored
Apr 10, 2018
by
Robert Lyon
Committed by
Gerrit Code Review
Apr 10, 2018
Browse files
Merge "Bug 1758769: Tutor role creates group views outside group edit window"
parents
fd9bee31
a6a9a12d
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/group.php
View file @
55b99655
...
...
@@ -183,14 +183,19 @@ function group_role_can_edit_views($group, $role) {
* the window.
* @param object $group the group to check
* @param bool $admin_always whether the admin should be OK regardless of time
* @param bool $tutor_always whether the tutor should be OK regardless of time
*/
function
group_within_edit_window
(
$group
,
$admin_always
=
true
)
{
function
group_within_edit_window
(
$group
,
$admin_always
=
true
,
$tutor_always
=
true
)
{
if
(
is_numeric
(
$group
))
{
$group
=
get_group_by_id
(
$group
,
true
);
}
if
(
$admin_always
&&
group_user_access
(
$group
->
id
)
==
'admin'
)
{
return
true
;
return
true
;
}
if
(
$tutor_always
&&
group_user_access
(
$group
->
id
)
==
'tutor'
)
{
return
true
;
}
$start
=
!
empty
(
$group
->
editwindowstart
)
?
strtotime
(
$group
->
editwindowstart
)
:
null
;
...
...
htdocs/view/submit.php
View file @
55b99655
...
...
@@ -29,7 +29,7 @@ $group = get_record_sql(
array
(
$USER
->
get
(
'id'
),
$groupid
)
);
if
(
!
$group
||
!
group_within_edit_window
(
$group
))
{
if
(
!
$group
||
!
group_within_edit_window
(
$group
id
))
{
throw
new
AccessDeniedException
(
get_string
(
'cantsubmittogroup'
,
'view'
));
}
...
...
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