Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
16639eb6
Commit
16639eb6
authored
Feb 06, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add permissions for task API
parent
947edbf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
Tasks.pm
PVE/API2/Tasks.pm
+17
-5
No files found.
PVE/API2/Tasks.pm
View file @
16639eb6
...
...
@@ -19,7 +19,10 @@ __PACKAGE__->register_method({
name
=>
'
node_tasks
',
path
=>
'',
method
=>
'
GET
',
permissions
=>
{
user
=>
'
all
'
},
permissions
=>
{
description
=>
"
List task associated with the current user, or all task the user has 'Sys.Audit' permissions on /nodes/<node> (the <node> the task runs on).
",
user
=>
'
all
'
},
description
=>
"
Read task list for one node (finished tasks).
",
proxyto
=>
'
node
',
parameters
=>
{
...
...
@@ -153,7 +156,10 @@ __PACKAGE__->register_method({
path
=>
'
{upid}
',
method
=>
'
DELETE
',
description
=>
'
Stop a task.
',
permissions
=>
{
user
=>
'
all
'
},
permissions
=>
{
description
=>
"
The user needs 'Sys.Modify' permissions on '/nodes/<node>' if the task does not belong to him.
",
user
=>
'
all
',
},
protected
=>
1
,
proxyto
=>
'
node
',
parameters
=>
{
...
...
@@ -176,7 +182,7 @@ __PACKAGE__->register_method({
my
$node
=
$param
->
{
node
};
if
(
$user
ne
$task
->
{
user
})
{
$rpcenv
->
check
(
$user
,
"
/nodes/
$node
",
[
'
Sys.
Console
'
]);
$rpcenv
->
check
(
$user
,
"
/nodes/
$node
",
[
'
Sys.
Modify
'
]);
}
PVE::RPCEnvironment::
check_worker
(
$param
->
{
upid
},
1
);
...
...
@@ -188,7 +194,10 @@ __PACKAGE__->register_method({
name
=>
'
read_task_log
',
path
=>
'
{upid}/log
',
method
=>
'
GET
',
permissions
=>
{
user
=>
'
all
'
},
permissions
=>
{
description
=>
"
The user needs 'Sys.Audit' permissions on '/nodes/<node>' if the task does not belong to him.
",
user
=>
'
all
',
},
protected
=>
1
,
description
=>
"
Read task log.
",
proxyto
=>
'
node
',
...
...
@@ -274,7 +283,10 @@ __PACKAGE__->register_method({
name
=>
'
read_task_status
',
path
=>
'
{upid}/status
',
method
=>
'
GET
',
permissions
=>
{
user
=>
'
all
'
},
permissions
=>
{
description
=>
"
The user needs 'Sys.Audit' permissions on '/nodes/<node>' if the task does not belong to him.
",
user
=>
'
all
',
},
protected
=>
1
,
description
=>
"
Read task status.
",
proxyto
=>
'
node
',
...
...
Write
Preview
Markdown
is supported
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