优化权限判断逻辑及相关代码

Signed-off-by: Zhang Jing <byrdkm17@gmail.com>