Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
yubarajshrestha committed Jun 10, 2022
1 parent 39c6cc6 commit b96d386
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Masonite Permission

<p align="center">
<img src="https://banners.beyondco.de/Masonite Permission.png?theme=light&packageManager=pip+install&packageName=masonite-permission&pattern=topography&style=style_1&description=Associate users with roles and permissions&md=1&showWatermark=1&fontSize=100px&images=https%3A%2F%2Fgblobscdn.gitbook.com%2Fspaces%2F-L9uc-9XAlqhXkBwrLMA%2Favatar.png">
<img src="https://banners.beyondco.de/Masonite%20Permission.png?theme=light&packageManager=pip+install&packageName=masonite-permission&pattern=charlieBrown&style=style_2&description=Associate+users+with+roles+and+permissions.&md=1&showWatermark=1&fontSize=100px&images=adjustments&widths=50&heights=50">
</p>

<p align="center">
Expand Down
56 changes: 56 additions & 0 deletions config/database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from masonite.environment import LoadEnvironment, env
from masoniteorm.connections import ConnectionResolver

# Loads in the environment variables when this page is imported.
LoadEnvironment()

"""
The connections here don't determine the database but determine the "connection".
They can be named whatever you want.
"""
DATABASES = {
"default": env("DB_CONNECTION", "sqlite"),
"sqlite": {
"driver": "sqlite",
"database": env("SQLITE_DB_DATABASE", "masonite.sqlite3"),
"prefix": "",
"log_queries": env("DB_LOG"),
},
"mysql": {
"host": "127.0.0.1",
"driver": "mysql",
"database": "masonite_permission",
"user": "meyubaraj",
"password": "MDB@123#go",
"port": 3306,
"prefix": "",
"grammar": "mysql",
"options": {
"charset": "utf8mb4",
},
"log_queries": env("DB_LOG"),
},
"postgres": {
"host": "127.0.0.1",
"driver": "postgres",
"database": "masonite_permission",
"user": "meyubaraj",
"password": "MDB@123#go",
"port": 5432,
"prefix": "",
"grammar": "postgres",
"log_queries": env("DB_LOG"),
},
"mssql": {
"driver": "mssql",
"host": env("MSSQL_DATABASE_HOST"),
"user": env("MSSQL_DATABASE_USER"),
"password": env("MSSQL_DATABASE_PASSWORD"),
"database": env("MSSQL_DATABASE_DATABASE"),
"port": env("MSSQL_DATABASE_PORT"),
"prefix": "",
"log_queries": env("DB_LOG"),
},
}

DB = ConnectionResolver().set_connection_details(DATABASES)
9 changes: 0 additions & 9 deletions config_

This file was deleted.

Binary file modified masonite.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version="0.1.8",
version="0.1.9",
packages=[
"masonite_permission",
"masonite_permission.config",
Expand Down
12 changes: 0 additions & 12 deletions src/masonite_permission/providers/PermissionGateProvider.py

This file was deleted.

1 change: 0 additions & 1 deletion src/masonite_permission/providers/PermissionProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def configure(self):
(
self.root("masonite_permission")
.name("masonite-permission")
.config("config/masonite_permission.py", publish=True)
.migrations("migrations/create_permissions_table.py")
)

Expand Down
1 change: 0 additions & 1 deletion src/masonite_permission/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# flake8: noqa: E501
from .PermissionProvider import PermissionProvider
from .PermissionGateProvider import PermissionGateProvider
3 changes: 1 addition & 2 deletions tests/integrations/config/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from masonite.notification.providers import NotificationProvider
from masonite.validation.providers import ValidationProvider

from src.masonite_permission.providers import PermissionProvider, PermissionGateProvider
from src.masonite_permission.providers import PermissionProvider

PROVIDERS = [
FrameworkProvider,
Expand All @@ -47,5 +47,4 @@
AuthorizationProvider,
ORMProvider,
PermissionProvider,
PermissionGateProvider,
]

0 comments on commit b96d386

Please sign in to comment.