def _check_permission(request, owner_name, error_msg, allow_root=False):
 if (request.user.username != owner_name):
  if (allow_root and request.user.is_superuser):
   return
  access_warn(request, error_msg)
  raise PopupException(_('Permission denied. You are not the owner.'))

def _check_permission ( request , owner_name , error_msg , allow_root = False ) : if ( request . user . username != owner_name ) : if ( allow_root and request . user . is_superuser ) : return access_warn ( request , error_msg ) raise PopupException ( _ ( 'Permission denied. You are not the owner.' ) )
raise popupexception if user doesnt have permission to modify the design .