Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
31295e76
authored
Jul 11, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix lease permissions
parent
c11cf23e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
circle/dashboard/templates/dashboard/template-list.html
+2
-0
circle/dashboard/views.py
+2
-1
circle/vm/models/common.py
+0
-1
No files found.
circle/dashboard/templates/dashboard/template-list.html
View file @
31295e76
...
...
@@ -26,9 +26,11 @@
<div
class=
"col-md-6"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
{% if perms.vm.create_leases %}
<a
href=
"{% url "
dashboard
.
views
.
lease-create
"
%}"
class=
"pull-right btn btn-success btn-xs"
style=
"margin-right: 10px;"
>
<i
class=
"icon-plus"
></i>
{% trans "new lease" %}
</a>
{% endif %}
<h3
class=
"no-margin"
><i
class=
"icon-time"
></i>
{% trans "Leases" %}
</h3>
</div>
<div
class=
"panel-body"
>
...
...
circle/dashboard/views.py
View file @
31295e76
...
...
@@ -2285,10 +2285,11 @@ class VmMassDelete(LoginRequiredMixin, View):
return
redirect
(
next
if
next
else
reverse_lazy
(
'dashboard.index'
))
class
LeaseCreate
(
LoginRequiredMixin
,
Superuser
RequiredMixin
,
class
LeaseCreate
(
LoginRequiredMixin
,
Permission
RequiredMixin
,
SuccessMessageMixin
,
CreateView
):
model
=
Lease
form_class
=
LeaseForm
permission_required
=
'vm.create_leases'
template_name
=
"dashboard/lease-create.html"
success_message
=
_
(
"Successfully created a new lease."
)
...
...
circle/vm/models/common.py
View file @
31295e76
...
...
@@ -97,7 +97,6 @@ class Lease(AclBase):
ordering
=
[
'name'
,
]
permissions
=
(
(
'create_leases'
,
_
(
'Can create new leases.'
)),
(
'bypass_leases'
,
_
(
'Can set arbitrary expiration times.'
)),
)
@property
...
...
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