Show 'Translate view' plugin to granted users only
Only users with read and write access on translation should have access to the plugin. issue4250 review13611002
This commit is contained in:
1 parent
5b2fda3e81
commit
d39bfa8906
1 file changed
+10
-4
@@ -1,8 +1,10 @@
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
#this repository contains the full copyright notices and license terms.
|
||||
from tryton.gui.window import Window
|
||||
import gettext
|
||||
|
||||
from tryton.gui.window import Window
|
||||
from tryton.common import MODELACCESS
|
||||
|
||||
_ = gettext.gettext
|
||||
|
||||
|
||||
@@ -14,6 +16,10 @@ def translate_view(datas):
|
||||
|
||||
|
||||
def get_plugins(model):
|
||||
return [
|
||||
(_('Translate view'), translate_view),
|
||||
]
|
||||
access = MODELACCESS['ir.translation']
|
||||
if access['read'] and access['write']:
|
||||
return [
|
||||
(_('Translate view'), translate_view),
|
||||
]
|
||||
else:
|
||||
return []
|
||||
Reference in new issue
Block a user