﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
10609	Permissions on admin actions	leitjohn	leitjohn	"Often one would not want an option to appear in the actions select box in the changelist. For instance, you may not want a user who can't delete to see ""delete_selected"".

I propose that we enable the admin to use the auth decorators (permission_required, etc).

{{{
Index: options.py
===================================================================
--- options.py	(revision 10163)
+++ options.py	(working copy)
@@ -423,7 +423,11 @@
         for klass in [self.admin_site] + self.__class__.mro()[::-1]:
             for action in getattr(klass, 'actions', []):
                 func, name, description = self.get_action(action)
-                actions[name] = (func, name, description)
+		
+                # check permission
+                test = getattr(func, ""test_func"", None)
+                if test == None or test(request.user):
+                    actions[name] = (func, name, description)
         return actions
}}}
"	New feature	closed	contrib.admin	dev	Normal	duplicate		code_djangoproject_com@… vvangelovski@… tomas.ehrlich@…	Accepted	1	0	1	1	0	0
