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

Permissions is not an object #469

Closed
g3ck0 opened this issue Dec 23, 2021 · 4 comments
Closed

Permissions is not an object #469

g3ck0 opened this issue Dec 23, 2021 · 4 comments

Comments

@g3ck0
Copy link

g3ck0 commented Dec 23, 2021

it may be lame, but the way to use the data pulled from the most parts of the system and permissions is not standard, for the rest of the system we use objects but for permissions there are arrays

for example getting all the groups i can do this:

$result = $authorize->groups();
                foreach ($result as $key => $value) {
                       $data['data'][$key] = array(
                        $value->name,
                        $value->description,
                        $ops,
                    );
                }

but for permissions i have to do this:

$result = $authorize->permissions();

                foreach ($result as $key => $value) {
                    $data['data'][$key] = array(
                        $value['name'],
                        $value['description'],
                        $ops,
                    );
                }
@MGatner
Copy link
Collaborator

MGatner commented Dec 24, 2021

I agree, but we've been stuck with that original design in order to prevent breaking changes before a major release. You can extend the model and change the $returnType property yourself for a quick fix. Or switch to Shield 🤗

@g3ck0
Copy link
Author

g3ck0 commented Dec 24, 2021

another lame question @MGatner , would you mind give me the link for shield?

@MGatner
Copy link
Collaborator

MGatner commented Dec 24, 2021

Not lame at all! Here ya go:

While I'm at it here are a couple other (potentially-)helpful auth tools that go along nicely with Myth and Shield:

Disclaimer: those are my authorship.

@g3ck0
Copy link
Author

g3ck0 commented Dec 24, 2021

thank you

@g3ck0 g3ck0 closed this as completed Dec 24, 2021
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

No branches or pull requests

2 participants