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

New role and capabilities manager #1584

Merged
merged 34 commits into from
Apr 28, 2022
Merged

Conversation

incraigulous
Copy link
Contributor

@incraigulous
Copy link
Contributor Author

incraigulous commented Feb 8, 2022

@corsacca See Travis log. Any tips on getting the composer install to work for PHP 8?

dt-contacts/base-setup.php Outdated Show resolved Hide resolved
dt-core/global-functions.php Outdated Show resolved Hide resolved
/**
* Dump and die
*/
if ( !function_exists( 'dd' ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

how is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It stands for dump and die. It dumps a given variable (or variables) and ends execution of the script. It's a convenience utility function you'll find in some PHP frameworks. I'm happy to remove it, but it's so much easier to write:

dd($foo, $bar); 

instead of:

var_dump($foo); var_dump($bar); exit;

@incraigulous
Copy link
Contributor Author

@corsacca, I've made a round of revisions. Let me know if you would like any further changes.

@incraigulous
Copy link
Contributor Author

@corsacca, any idea why there are tests failing? Those don't seem to be related to my work.

composer.json Outdated Show resolved Hide resolved
tests/install-wp-tests.sh Outdated Show resolved Hide resolved
tests/bootstrap.php Outdated Show resolved Hide resolved
@incraigulous
Copy link
Contributor Author

@corsacca, I reverted the phpunit changes. I'll hold on making a pull request for that. I was pretty sure that wasn't the right solution. I was just getting it working for me locally, but I'm sure it's not the right solution (see our slack conversation regarding from around the time of the commit).

@corsacca
Copy link
Member

corsacca commented Mar 2, 2022

@incraigulous small issue with tab not opening:
tab

@corsacca
Copy link
Member

corsacca commented Mar 2, 2022

@incraigulous
I'd expect a new role to show up here:
image

@corsacca
Copy link
Member

corsacca commented Mar 2, 2022

These are wp caps:
image

@incraigulous
Copy link
Contributor Author

@incraigulous I'd expect a new role to show up here: image

@corsacca I was able to solve this by loading the roles on the front-end as well as the back-end. You mentioned in a previous comment that you wanted me to set up the custom roles in dt-core/setup-functions.php, so I wanted to highlight that I made this change.

@incraigulous
Copy link
Contributor Author

incraigulous commented Mar 17, 2022

These are wp caps: image

@corsacca Odd... those roles aren't showing up for me anymore, though they used to. I assumed you removed them. Can you confirm your WP is updated to the latest version and that they are still showing up for you?

Screen Shot 2022-03-17 at 3 54 23 PM

?

@corsacca
Copy link
Member

@incraigulous you are right about the roles setup needing to be available on each request.
suggestion: thecodezone#2

For the level 0 to level 10. I checked out the branch on 3 instances, one of them a clean install and see the them show up.

@incraigulous
Copy link
Contributor Author

@corsacca, I just pushed a commit to allow us to remove specific capabilities, namely, level_0 - level_9.

@corsacca
Copy link
Member

Thank @incraigulous. Would you be able to fix the phpcs check?

@incraigulous
Copy link
Contributor Author

incraigulous commented Apr 27, 2022 via email

@corsacca
Copy link
Member

Thank you @incraigulous !

@corsacca corsacca merged commit 5a077a4 into DiscipleTools:master Apr 28, 2022
@incraigulous
Copy link
Contributor Author

🥳 , thank you, @corsacca!

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

Successfully merging this pull request may close these issues.

None yet

2 participants