Skip to main content

Posts

Showing posts with the label authentication

Twitter official client for Mac problem "Unauthorized" solving.

I had a problem "Unauthorized" in official twitter client for Mac. Tried several instal/reinstall. Deleted/Downloaded again from Apple App Store. It all didn't help. They seem to change something in authentication. So I've tried deleting all the config files in ~/Library/ Main solution that helped me: 1. Switch off the client. (be sure to Close an app) 2. Delete: ~/Library/Preferences/com.twitter.twitter-mac.plist.lockfile ~/Library/Preferences/com.twitter.twitter-mac.plist 3. Launch Twitter app and login from scratch. I have revoked access this twitter client too in my https://twitter.com/settings/applications  but it seem to make no effect. Making similar actions to TweetDeck for Mac does not help. So it seems like problem is somewhere deeper. Hope it will help you solve similar issue.

Users, Groups and their Permissions in Django + Recipes

Django supports security models and methods out of the box. They are Group and Permission objects. Permission is m2m related to internal Django User. I helps you relay on request.user later in your code. You often come to situations where you may need a view to be accessed only by certain group of users.  For example you have the app that has two groups of users. One can search and another one can Index files. Simplest approach is to use Groups here.  In fact you may use permissions in case your app will have several unique users that might do some stuff. In general best approach is to use Group to specify type of users and Permission to specify the role of users in this group. So if you will have Group called 'search' and it will have permission with name, say 'search stuff'. So when you will call: def my_view (request): # ... my view actions ... user_permissions = request.user.user_permissions.all() for p in user...