Closed (fixed)
Project:
Profile
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
23 Dec 2015 at 18:29 UTC
Updated:
12 Feb 2016 at 16:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
subhojit777Comment #3
subhojit777Currently profile list is broken, see #2644090: Page not found in profile listing page.
After we fix #2644090: Page not found in profile listing page, I want to make sure - do we need to add a new operation "Default/Undefault" in the profile list, similar to what we have in here

admin/commerce/config/currency@bojanz can you please confirm.
Comment #4
subhojit777It's working. We need to write tests.
Comment #5
subhojit777Comment #6
naveenvalechaComment #7
subhojit777Well $profile->isDefault() is returning false even if set to default, not sure.. Any idea?
Comment #10
mglamanI know I said to fix these, but let's wait until later since they failed, too.
I made a ProfileDefaultTest, let's move this there.
This wasn't working for me. I had to manually run ->setActive(TRUE) before save. See examples in ProfileDefaultTest.
Comment #11
subhojit777Comment #12
naveenvalechaDo we need a _csrf_token: 'TRUE' here to prevent CSRF ?
as in this function we are updating the profile entity.
Although this route is behind 'administer profiles' but with chain attack of XSS(with twig in core its no where by default) it can be exploitable.
Comment #13
mglamanPer #12: Yeah, let's do it. I was thinking "nah, it still needs a valid profile ID", but Core does it for comment approval.
It can't hurt.
Comment #14
subhojit777makes sense :)
Comment #17
mglamanShoot. Remove whatever is asserting the link
:/ We can't do this on D.o test bot. I think it's just because paths are goofy. I wish we could assert text, maybe by the index?
I'd be fine skipping it.
Comment #18
subhojit777But it was passing fine in #12
EDIT:
Sorry I got it. It's because of CSRF token.
Comment #19
subhojit777Comment #20
mglamanLooks good. I just want to get bojanz to take a peak and verify this is what we're going for, looks like it, though.
Comment #21
bojanz commentedSo it won't work for ordinary users?
Comment #22
mglamanOops. Good catch. Should be "edit own profiles"
Comment #23
subhojit777Comment #24
subhojit777This was twice. I hope it makes sense to remove this in this issue.
It's already there in the
setUp()Question: Do I need to show in the test that user having "edit own profiles" permission gets 403 error while marking profiles as default?
Comment #25
mglamanWait, do you mean does not get 403? Or for other user profiles? Sorry I think I'm just reading comment wrong. We probably should show that "user1 cannot set user2's default profile without proper access"
Comment #26
subhojit777Yes that's what I meant, thanks for the clarification :)
Comment #27
subhojit777Comment #29
mglamanComment #30
naveenvalechaDoes $restricted_user really needs the administer profiles permission ? I did not find any other use of restricted user other than creating its own profile.
Did I miss something ?
Comment #31
mglamannaveenvalecha, shoot. mind just opening a new issue to fix the test with the patch?
Comment #32
subhojit777We are testing whether "default" functionality actually works, and also testing whether it works from the UI. The UI option is available only in profile listing page. To view the profile listing page you need "administer profiles" permission. That is why
$restricted_userneeds that permission.The purpose of
$restricted_useris to check whether he is able to set default his own profile, and is unable to set default others' profile. That is the only purpose of$restricted_user.Comment #33
naveenvalecha#32, cleared the usage of administer profiles.