permission system changed

change permission check system to an easier version:
permission(permissionId, directoryId, userId);
the correspoding hasPermission(User u, String dirName) is updated;