working with django Viewflow by non-superusers not superuser

72 views Asked by At

I'm learning django viewflow (non-Pro) and the all processes that I've been creating works for superuser users only

is any way to use django viewflow by normal user or non superuser

or another way to disable django permission checking for django viewflow

please help me.

error list when i refer to process list in app:

...\lib\site-packages\viewflow\flow\views\mixins.py", line 24, in dispatch return permission_required(self.flow_class._meta.view_permission_name, raise_exception=True)

1

There are 1 answers

0
Arash zargari marandi On BEST ANSWER

non-Superuser limitation will be neutralized by Edit below file:

your Environment Address\Lib\site-packages\django\contrib\auth\decorators.py

please Edit decorators.py file as below:

  def permission_required(perm, login_url=None, raise_exception=False):

      def check_perms(user):
         # if isinstance(perm, str):
         #     perms = (perm,)
         # else:
         #     perms = perm
         # # First check if the user has the permission (even anon users)
         # if user.has_perms(perms):
         #     return True
         # # In case the 403 handler should be called raise the exception
         # if raise_exception:
         #     raise PermissionDenied
         # # As the last resort, show the login form
      return True
   return user_passes_test(check_perms, login_url=login_url)

if you have problem by neutralize non-Superuser limitation please Email your problem to me:

my E-mail: [email protected]

my Mobile: +989371067953

scincerly Arash