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

Public organizations and projects are now visible to all users #246

Merged
merged 2 commits into from
Jun 16, 2016

Conversation

linzjax
Copy link
Contributor

@linzjax linzjax commented Jun 15, 2016

Added new 'loadpolicies' manager command, and removed all lazy loading policies. - fixes #188
Updated all tests to run loadpolicies in setUp
Also commented out private organization button in UI - fixes #237

Notes:
IndexPage only redirects to Dashboard. Does it need to be deleted, or is there a different expect behavior?

def test_get_without_user(self):
# I'm not sure why I'm having to explicitely call this
# when using AnonymousUser()
assign_user_policies(None, Policy.objects.get(name='default'))
Copy link
Contributor Author

@linzjax linzjax Jun 15, 2016

Choose a reason for hiding this comment

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

I'm not sure why loadpolicies works with everything except when user=AnonymousUser(), which is why I'm explicitly calling assign_user_policies here. It's working in the UI and everywhere else, so I wonder if it's specific to AnonymousUser()?

@wonderchook
Copy link
Contributor

@linzjax making Dashboard the index page?

@linzjax
Copy link
Contributor Author

linzjax commented Jun 15, 2016

Correct. All index is doing now is redirecting to cadasta.org/dashboard. Is the /dashboard endpoint necessary, or would it work to make the dashboard the base cadasta.org/ ?

@wonderchook
Copy link
Contributor

Yes, this seems redundant and can be removed. Later when we add a dashboard for logged in users we can bring it back but it won't be the same thing as the front page is now.

@oliverroick
Copy link
Member

There is a difference between index and dashboard. The index page is where you end up when you haven't logged in. After you logged in, you're redirected to the dashboard. When you try to access the index page, you should be redirected to the dashboard automatically if you're logged in from a previous session.

@ian-ross
Copy link
Contributor

@oliverroick Can you make a separate issue for dealing with that? I'm looking at this PR now, and it looks like there might be a tutelary bug I need to fix to go with it, so I'd prefer it if Lindsey didn't try to make any more changes here for the moment.

@oliverroick
Copy link
Member

Not sure if this is an issue at all. Was just outlining why had both index and dashboard pages in the first place. If we have changed that flow, that's fine.

… times.

IndexPage only redirects to Dashboard. Does it need to be deleted, or is there a different expect behavior?

added new 'loadpolicies' manager command, and removed all lazy loading policies.
@ian-ross ian-ross force-pushed the bugs/logged-out-org-view branch from 437cc8b to 2f67044 Compare June 16, 2016 11:11
The handling of anonymous users in tutelary was broken.  Fixed now, and
various "unauthorised user" tests updated to reflect the new corrected
behaviour.
@ian-ross
Copy link
Contributor

I had to fix a tutelary bug related to anonymous users to make this work. Also moved the assign_user_polcies call for the anonymous user into the loadpolicies management command and updated some API tests to reflect the new (correct) behaviour for anonymous users. Otherwise, good work, @linzjax!

@ian-ross ian-ross merged commit a517253 into master Jun 16, 2016
@ian-ross ian-ross deleted the bugs/logged-out-org-view branch June 16, 2016 14:00
@wonderchook
Copy link
Contributor

@oliverroick I think the flow will make sense when we have something for logged in users that is different from the anonymous ones. I could see a dashboard giving them an overview of what has happened since they last logged in for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants