updated profile permission

This commit is contained in:
Nabin Hait 2012-08-13 13:15:36 +05:30
parent c3de42c892
commit 22aa31ead2
4 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,35 @@
from __future__ import unicode_literals
def execute():
import webnotes
import webnotes.model.doc
webnotes.conn.sql("delete from `tabDocPerm` where parent='Profile' and permlevel=1")
new_perms = [
{
'parent': 'Profile',
'parentfield': 'permissions',
'parenttype': 'DocType',
'role': 'Administrator',
'permlevel': 1,
'read': 1,
'write': 1
},
{
'parent': 'Profile',
'parentfield': 'permissions',
'parenttype': 'DocType',
'role': 'System Manager',
'permlevel': 1,
'read': 1,
'write': 1
},
]
for perms in new_perms:
doc = webnotes.model.doc.Document('DocPerm')
doc.fields.update(perms)
doc.save()
webnotes.conn.commit()
webnotes.conn.begin()
import webnotes.model.sync
webnotes.model.sync.sync('core', 'profile')

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import webnotes
def execute():

View File

@ -548,5 +548,9 @@ patch_list = [
{
'patch_module': 'patches.august_2012',
'patch_file': 'task_allocated_to_assigned',
},
{
'patch_module': 'patches.august_2012',
'patch_file': 'change_profile_permission',
}
]

View File

@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import webnotes
@webnotes.whitelist()