Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quiz-3157376
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
quiz-3157376
Commits
ca9e33d2
Commit
ca9e33d2
authored
14 years ago
by
falcon
Browse files
Options
Downloads
Patches
Plain Diff
Fixed: Accounting for the administer nodes access
parent
855b8e7d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
question_types/quiz_question/quiz_question.core.inc
+4
-4
4 additions, 4 deletions
question_types/quiz_question/quiz_question.core.inc
with
4 additions
and
4 deletions
question_types/quiz_question/quiz_question.core.inc
+
4
−
4
View file @
ca9e33d2
...
...
@@ -159,9 +159,9 @@ abstract class QuizQuestion {
$form
=
array_merge
(
$form
,
$this
->
getCreationForm
(
$form_state
));
// If access to edit quizzes we add the add to quiz fieldset
$edit_access
=
user
_access
(
'edit any quiz'
)
||
user_access
(
'edit own quiz
'
);
$edit_access
=
quiz
_access
_multi_or
(
'edit any quiz'
,
'edit own quiz'
,
'administer nodes
'
);
if
(
$edit_access
)
{
$own_filter
=
user
_access
(
'edit any quiz'
)
?
''
:
'AND n.uid = '
.
intval
(
$user
->
uid
);
$own_filter
=
quiz
_access
_multi_or
(
'edit any quiz'
,
'administer nodes'
)
?
''
:
'AND n.uid = '
.
intval
(
$user
->
uid
);
// Fieldset allowing question makers to add questions to multiple quizzes when creating or editing a question
$already
=
array
();
...
...
@@ -243,7 +243,7 @@ abstract class QuizQuestion {
$latest_default
[]
=
$quiz
->
nid
.
'-'
.
$quiz
->
vid
;
}
}
if
(
$edit_access
||
user
_access
(
'create quiz'
))
{
if
(
$edit_access
||
quiz
_access
_multi_or
(
'create quiz'
,
'administer nodes'
))
{
$form
[
'add_directly'
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
t
(
'Add to quiz'
),
...
...
@@ -274,7 +274,7 @@ abstract class QuizQuestion {
);
}
}
if
(
user
_access
(
'create quiz'
))
{
if
(
quiz
_access
_multi_or
(
'create quiz'
,
'administer nodes'
))
{
$form
[
'add_directly'
][
'new'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Title for new quiz'
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment