Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation related permissions and self-selection, planning and design #65 #68

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

MichaelSuarez22
Copy link

@MichaelSuarez22 MichaelSuarez22 commented Sep 11, 2023

In this case a reimplementation and editing of the permissions system that contains the Django Gentelella widgets program was performed. Among its main modifications is for example the ability to create, delete, add and edit permissions along with other related permissions, it should be noted that each permission can have multiple permissions, a single permission or may not even have any associated permissions. In addition it is important to emphasize that to achieve the above is made use of the Django API rest framework, so you can bring the data of the permissions that are within the administration of Django. Likewise at the graphical interface level, just select a user and then select the permission you want to add, once you choose and check the permission, other checkboxes related to that permission are displayed or a message is displayed indicating that there are no related permissions. Also within the modal in which these permissions are present, there is a third section that will be used as a means of help and information for the user who manipulates the permissions system of the program.

For more information you can consult: #65

Copy link
Contributor

@allexiusw allexiusw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggestions around Docstring, merge conflicts and some test naming conventions. Feel free to reject them if you think they are not relevant. Overall nice job done here Michael.

Comment on lines +31 to +33
#this unit test verifies the error handling behavior of an API view in Django by making a request
# to a dynamic URL with a specific resource_id value and ensuring that the view responds with a 404 status code
# if the resource is not found.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#this unit test verifies the error handling behavior of an API view in Django by making a request
# to a dynamic URL with a specific resource_id value and ensuring that the view responds with a 404 status code
# if the resource is not found.

Comment on lines 35 to 36
class ErrorHandlingAPITestCase(TestCase):
def setUp(self):

This comment was marked as outdated.

This comment was marked as outdated.

Comment on lines 70 to 73
#this unit test verifies that the update_related_permission function can correctly update
# existing related permissions and properly handles the situation
# where the related permission is not found in the list of existing permissions.

This comment was marked as outdated.

# Otras propiedades necesarias
)

def test_retrieve_permission_related_detail(self):

This comment was marked as outdated.

Comment on lines 896 to 908
class PermissionRelatedAPITest(TestCase):
def setUp(self):
self.client = APIClient()

def test_retrieve_nonexistent_permission_related_detail(self):
# Define un 'permission_id' que no existe en la base de datos
nonexistent_permission_id = 9999

url = reverse('api_related_permissions_detail', kwargs={'permission_id': nonexistent_permission_id})
response = self.client.get(url)

# Verifica que la respuesta tenga un código de estado 404 (Not Found)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

This comment was marked as outdated.

Comment on lines 25 to 26
<!-- Botones de Vista, Edición y Eliminación (si el usuario tiene los permisos correspondientes) -->

This comment was marked as outdated.

Comment on lines 23 to 25
=======
from djgentelella.models import PermissionRelated
>>>>>>> nueva-rama

This comment was marked as outdated.

import unittest
from django.test import TestCase
from django.conf import settings
<<<<<<< HEAD

This comment was marked as outdated.

from django.test import TestCase
from django.conf import settings
<<<<<<< HEAD
from djgentelella.models import PermissionRelated # Reemplaza 'yourapp' con el nombre real de tu aplicación

This comment was marked as outdated.

@@ -3,3 +3,4 @@
from .StoryMap_Test import *
from .TimeLine_Test import *
from .Notification_Test import *
from .API_test import*

This comment was marked as outdated.

Copy link
Contributor

@allexiusw allexiusw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants