Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Elijah Grubb
emulab-devel
Commits
d2a92393
Commit
d2a92393
authored
Jul 09, 2018
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Oops, left this out of commit
108d3d6f
.
parent
b3293f40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
www/aptui/instance_defs.php
www/aptui/instance_defs.php
+18
-0
No files found.
www/aptui/instance_defs.php
View file @
d2a92393
...
...
@@ -946,6 +946,24 @@ class InstanceHistory
$row
=
mysql_fetch_array
(
$query_result
);
return
InstanceHistory
::
Lookup
(
$row
[
0
]);
}
#
# Permission check; does user have permission to view instance.
#
function
CanView
(
$user
)
{
if
(
$this
->
creator_idx
()
==
$user
->
uid_idx
())
{
return
1
;
}
# Otherwise a project membership test.
$project
=
Project
::
Lookup
(
$this
->
pid_idx
());
if
(
!
$project
)
{
return
0
;
}
$isapproved
=
0
;
if
(
$project
->
IsMember
(
$user
,
$isapproved
)
&&
$isapproved
)
{
return
1
;
}
return
0
;
}
}
class
InstanceSliver
...
...
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