示例#1
0
 def get_context_data(self, **kwargs):
     context = super(GroupListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm('auth.admin_group')
     context['has_create'] = self.request.user.has_perm('auth.create_group')
     context['object_list'] = get_object_list(self.request.user, Group,
                                              'name')
     return context
示例#2
0
 def get_context_data(self, **kwargs):
     context = super(BlueprintListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm(
         'blueprints.admin_blueprint')
     context['has_create'] = self.request.user.has_perm(
         'blueprints.create_blueprint')
     context['object_list'] = get_object_list(self.request.user, Blueprint)
     return context
示例#3
0
 def get_context_data(self, **kwargs):
     context = super(ImageListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm(
         'cloud.admin_cloudimage')
     context['has_create'] = self.request.user.has_perm(
         'cloud.create_cloudimage')
     context['object_list'] = get_object_list(self.request.user, CloudImage)
     return context
示例#4
0
 def get_context_data(self, **kwargs):
     context = super(FormulaListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm(
         'formulas.admin_formula')
     context['has_create'] = self.request.user.has_perm(
         'formulas.create_formula')
     context['object_list'] = get_object_list(self.request.user, Formula)
     return context
示例#5
0
 def get_context_data(self, **kwargs):
     context = super(SnapshotListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm(
         'cloud.admin_snapshot')
     context['has_create'] = self.request.user.has_perm(
         'cloud.create_snapshot')
     context['object_list'] = get_object_list(self.request.user, Snapshot)
     return context
示例#6
0
 def get_context_data(self, **kwargs):
     context = super(AccountListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm('cloud.admin_cloudaccount')
     context['has_create'] = self.request.user.has_perm('cloud.create_cloudaccount')
     context['object_list'] = get_object_list(self.request.user, CloudAccount)
     return context
示例#7
0
 def get_context_data(self, **kwargs):
     context = super(GroupListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm('auth.admin_group')
     context['has_create'] = self.request.user.has_perm('auth.create_group')
     context['object_list'] = get_object_list(self.request.user, Group, 'name')
     return context
示例#8
0
 def get_context_data(self, **kwargs):
     context = super(StackListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm('stacks.admin_stack')
     context['has_create'] = self.request.user.has_perm('stacks.create_stack')
     context['object_list'] = get_object_list(self.request.user, Stack)
     return context
示例#9
0
 def get_context_data(self, **kwargs):
     context = super(StackListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm('stacks.admin_stack')
     context['has_create'] = self.request.user.has_perm('stacks.create_stack')
     context['object_list'] = get_object_list(self.request.user, Stack)
     return context
示例#10
0
 def get_context_data(self, **kwargs):
     context = super(BlueprintListView, self).get_context_data(**kwargs)
     context["has_admin"] = self.request.user.has_perm("blueprints.admin_blueprint")
     context["has_create"] = self.request.user.has_perm("blueprints.create_blueprint")
     context["object_list"] = get_object_list(self.request.user, Blueprint)
     return context
示例#11
0
 def get_context_data(self, **kwargs):
     context = super(SnapshotListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm('cloud.admin_snapshot')
     context['has_create'] = self.request.user.has_perm('cloud.create_snapshot')
     context['object_list'] = get_object_list(self.request.user, Snapshot)
     return context
示例#12
0
 def get_context_data(self, **kwargs):
     context = super(FormulaListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm('formulas.admin_formula')
     context['has_create'] = self.request.user.has_perm('formulas.create_formula')
     context['object_list'] = get_object_list(self.request.user, Formula)
     return context
示例#13
0
 def get_context_data(self, **kwargs):
     context = super(EnvironmentListView, self).get_context_data(**kwargs)
     context['has_admin'] = self.request.user.has_perm('environments.admin_environment')
     context['has_create'] = self.request.user.has_perm('environments.create_environment')
     context['object_list'] = get_object_list(self.request.user, Environment)
     return context