From ab2e096f7bde0098d283caf56c89e9bda2539213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Thu, 30 Jun 2016 15:42:42 +0300 Subject: [PATCH] permission set feature --- opt/ahenk/base/util/util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opt/ahenk/base/util/util.py b/opt/ahenk/base/util/util.py index 19f37a1..0f3f2b8 100644 --- a/opt/ahenk/base/util/util.py +++ b/opt/ahenk/base/util/util.py @@ -13,6 +13,7 @@ import hashlib import datetime import uuid + class Util: def __init__(self): super().__init__() @@ -83,7 +84,7 @@ class Util: def read_file(full_path, mode='r'): content = None try: - with open(full_path,mode) as f: + with open(full_path, mode) as f: content = f.read() except: raise @@ -243,3 +244,7 @@ class Util: @staticmethod def generate_uuid(): return str(uuid.uuid4()) + + @staticmethod + def set_permission(path, permission_code): + Util.execute('chmod {} {}'.format(permission_code, path))