Update Private user attributes
							parent
							
								
									92546024d8
								
							
						
					
					
						commit
						ac52768ca7
					
				@ -1,42 +0,0 @@
 | 
			
		||||
# Generated by Django 4.2.5 on 2023-09-28 13:51
 | 
			
		||||
 | 
			
		||||
from django.db import migrations, models
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Migration(migrations.Migration):
 | 
			
		||||
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ('abac', '0001_initial'),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    operations = [
 | 
			
		||||
        migrations.RemoveField(
 | 
			
		||||
            model_name='attribute',
 | 
			
		||||
            name='last_modified',
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AddField(
 | 
			
		||||
            model_name='rule',
 | 
			
		||||
            name='delete',
 | 
			
		||||
            field=models.BooleanField(default=False),
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AddField(
 | 
			
		||||
            model_name='rule',
 | 
			
		||||
            name='read',
 | 
			
		||||
            field=models.BooleanField(default=False),
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AddField(
 | 
			
		||||
            model_name='rule',
 | 
			
		||||
            name='write',
 | 
			
		||||
            field=models.BooleanField(default=False),
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AddField(
 | 
			
		||||
            model_name='ruleattribute',
 | 
			
		||||
            name='option',
 | 
			
		||||
            field=models.CharField(choices=[('EQ', 'Equals'), ('NEQ', "Doesn't Equal"), ('GT', 'Greater Than'), ('LT', 'Less Than')], default='EQ', max_length=3),
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AddField(
 | 
			
		||||
            model_name='userattribute',
 | 
			
		||||
            name='last_modified',
 | 
			
		||||
            field=models.DateTimeField(auto_now=True),
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
@ -1,18 +0,0 @@
 | 
			
		||||
# Generated by Django 4.2.5 on 2023-09-28 14:49
 | 
			
		||||
 | 
			
		||||
from django.db import migrations
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Migration(migrations.Migration):
 | 
			
		||||
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ('abac', '0002_remove_attribute_last_modified_rule_delete_rule_read_and_more'),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    operations = [
 | 
			
		||||
        migrations.RenameField(
 | 
			
		||||
            model_name='ruleattribute',
 | 
			
		||||
            old_name='option',
 | 
			
		||||
            new_name='operator',
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
@ -0,0 +1,45 @@
 | 
			
		||||
{% extends 'base.html' %}
 | 
			
		||||
 | 
			
		||||
{% block title %}User Management{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<form method="post" class="mb-3">
 | 
			
		||||
    {% csrf_token %}
 | 
			
		||||
    <div class="form-row align-items-center">
 | 
			
		||||
      <div class="col-auto">
 | 
			
		||||
        <label class="sr-only" for="username">Username</label>
 | 
			
		||||
        <input type="text" class="form-control mb-2" id="username" name="username" placeholder="Username" required>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="col-auto">
 | 
			
		||||
        <label class="sr-only" for="password">Password</label>
 | 
			
		||||
        <input type="password" class="form-control mb-2" id="password" name="password" placeholder="Password" required>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="col-auto">
 | 
			
		||||
        <div class="form-check mb-2">
 | 
			
		||||
          <input class="form-check-input" type="checkbox" id="is_superuser" name="is_superuser">
 | 
			
		||||
          <label class="form-check-label" for="is_superuser">Superuser</label>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="col-auto">
 | 
			
		||||
        <button type="submit" class="btn btn-primary mb-2">Create User</button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </form>
 | 
			
		||||
 | 
			
		||||
  <table class="table table-striped">
 | 
			
		||||
    <thead>
 | 
			
		||||
      <tr>
 | 
			
		||||
        <th>Username</th>
 | 
			
		||||
        <th>Is Superuser</th>
 | 
			
		||||
      </tr>
 | 
			
		||||
    </thead>
 | 
			
		||||
    <tbody>
 | 
			
		||||
      {% for user in users %}
 | 
			
		||||
        <tr>
 | 
			
		||||
          <td><a href="{% url 'abac:user_details' username=user.username %}">{{ user.username }}</a></td>
 | 
			
		||||
          <td>{{ user.is_superuser|yesno:"Yes,No" }}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
      {% endfor %}
 | 
			
		||||
    </tbody>
 | 
			
		||||
  </table>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue