title: Django CBV - How can I check a user's custom attributes to allow access to a view
body: <p>I'm having a problem when checking custom attributes of a user to allow access to the view.</p>
  
  <p>Lets suppose I just want to allow access to the users that have activated in their userprofile the self_store option.</p>
  
  <p>When i use function views is very easy i put this in the beginning of the view and works fine</p>
  
  <pre><code>if not request.user.is_authenticated():
      return redirect('auth_login')
  
  if not request.user.userprofile.self_store:
      return do_something_here
  </code></pre>
  
  <p>Well like i said is very easy to use and do different things for different options activated or not in my userprofile</p>
  
  <p>But i cant find the way to do this in class based views, if i want to allow access to the users that have activated the self_store option in the usersprofile how can i do for example in this updateview</p>
  
  <pre><code>class ClientUpdateView(UpdateView):
  
  model = Client
  template_name = "clients/update.html"
  pk_url_kwarg = 'client_id'
  fields = [
      'first_name',
      'last_name',
      'email',
      'phone',
      'phone_2',
      'address',
  ]
  </code></pre>
  
  <p>I can use logginrequired mixin perfect but i want to check like i said custom users properties that i use in the userprofile.</p>
  
  <p>The check that i need to make is something like the PermissionRequired Mixin but for the attributes in the userprofile.</p>