Add IntelliJ IDEA project configuration files
This commit adds IntelliJ IDEA-specific configuration files for the project, including module setup, version control integration, inspection profiles, and workspace settings. These files facilitate development environment configuration for contributors using IntelliJ IDEA.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from django.contrib.auth.backends import ModelBackend
|
||||
|
||||
|
||||
class CompanyUserBackend(ModelBackend):
|
||||
def get_user_permissions(self, user_obj, obj=None):
|
||||
if not user_obj.is_active or user_obj.is_anonymous:
|
||||
return set()
|
||||
|
||||
if user_obj.is_superuser:
|
||||
return super().get_user_permissions(user_obj, obj)
|
||||
|
||||
perms = super().get_user_permissions(user_obj, obj)
|
||||
if user_obj.company and user_obj.company.is_client:
|
||||
# Filter permissions based on client company context
|
||||
perms = {p for p in perms if p.startswith('accounts.client_')}
|
||||
return perms
|
||||
Reference in New Issue
Block a user