12345678910 |
- from file.models import File
- from folder.models import Folder
- from account.models import User
- def can_delete(user, f):
- if not isinstance(user, User) or (not isinstance(f, File) and not isinstance(f, Folder)):
- raise TypeError('File or Folder expected.')
- return f.father_folder and f.father_folder.check_permission(user=user) and (
- f.owner == user or (f.group and f.group.creator == user))
|