diff options
Diffstat (limited to 'python-django-graphene-permissions.spec')
| -rw-r--r-- | python-django-graphene-permissions.spec | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/python-django-graphene-permissions.spec b/python-django-graphene-permissions.spec new file mode 100644 index 0000000..6a15afe --- /dev/null +++ b/python-django-graphene-permissions.spec @@ -0,0 +1,111 @@ +%global _empty_manifest_terminate_build 0 +Name: python-django-graphene-permissions +Version: 0.0.4 +Release: 1 +Summary: DRF like permission system for django graphene +License: BSD +URL: https://github.com/taoufik07/django-graphene-permissions +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/74/81/42f847d9b767155ba0dad3acbb007d38657a128b1f700dbc01de2e70df43/django_graphene_permissions-0.0.4.tar.gz +BuildArch: noarch + + +%description +You can create new permissions by subclassing `BasePermission` e.g. +```python +from django_graphene_permissions.permissions import BasePermission +class MyPermission(BasePermission): + @staticmethod + def has_permission(context): + return context.user and context.user.is_authenticated + @staticmethod + def has_object_permission(context, obj): + return True +``` +This package provides predefined permissions : +* `AllowAny` : Allow any access. +* `IsAuthenticated` : Allow only authenticated users. + +%package -n python3-django-graphene-permissions +Summary: DRF like permission system for django graphene +Provides: python-django-graphene-permissions +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-django-graphene-permissions +You can create new permissions by subclassing `BasePermission` e.g. +```python +from django_graphene_permissions.permissions import BasePermission +class MyPermission(BasePermission): + @staticmethod + def has_permission(context): + return context.user and context.user.is_authenticated + @staticmethod + def has_object_permission(context, obj): + return True +``` +This package provides predefined permissions : +* `AllowAny` : Allow any access. +* `IsAuthenticated` : Allow only authenticated users. + +%package help +Summary: Development documents and examples for django-graphene-permissions +Provides: python3-django-graphene-permissions-doc +%description help +You can create new permissions by subclassing `BasePermission` e.g. +```python +from django_graphene_permissions.permissions import BasePermission +class MyPermission(BasePermission): + @staticmethod + def has_permission(context): + return context.user and context.user.is_authenticated + @staticmethod + def has_object_permission(context, obj): + return True +``` +This package provides predefined permissions : +* `AllowAny` : Allow any access. +* `IsAuthenticated` : Allow only authenticated users. + +%prep +%autosetup -n django-graphene-permissions-0.0.4 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-django-graphene-permissions -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.4-1 +- Package Spec generated |
