updated profile permission
This commit is contained in:
parent
c3de42c892
commit
22aa31ead2
35
erpnext/patches/august_2012/change_profile_permission.py
Normal file
35
erpnext/patches/august_2012/change_profile_permission.py
Normal 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')
|
@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
|
@ -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',
|
||||
}
|
||||
]
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user