Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Authorization Bundle Help

Received: by 10.180.75.8 with SMTP id y8mr1354933wiv.4.1344866472093;
        Mon, 13 Aug 2012 07:01:12 -0700 (PDT)
X-BeenThere: ravendb@googlegroups.com
Received: by 10.216.209.206 with SMTP id s56ls6278062weo.1.gmail; Mon, 13 Aug
 2012 07:01:09 -0700 (PDT)
Received: by 10.180.82.226 with SMTP id l2mr1355492wiy.1.1344866469971;
        Mon, 13 Aug 2012 07:01:09 -0700 (PDT)
Received: by 10.180.82.226 with SMTP id l2mr1355491wiy.1.1344866469962;
        Mon, 13 Aug 2012 07:01:09 -0700 (PDT)
Return-Path: <p...@ukcreativedesigns.com>
Received: from ukcreativedesigns.com (hinetaa1.miniserver.com. [89.200.141.16])
        by gmr-mx.google.com with SMTP id hm1si1784752wib.3.2012.08.13.07.01.09;
        Mon, 13 Aug 2012 07:01:09 -0700 (PDT)
Received-SPF: neutral (google.com: 89.200.141.16 is neither permitted nor denied by best guess record for domain of p...@ukcreativedesigns.com) client-ip=89.200.141.16;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 89.200.141.16 is neither permitted nor denied by best guess record for domain of p...@ukcreativedesigns.com) smtp.mail=p...@ukcreativedesigns.com
Received: from [127.0.0.1] ([86.185.217.80])
	by ukcreativedesigns.com
	; Mon, 13 Aug 2012 15:01:09 +0100
Message-ID: <502908A5.4040403@ukcreativedesigns.com>
Date: Mon, 13 Aug 2012 15:01:09 +0100
From: Paul Hinett <p...@ukcreativedesigns.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0
MIME-Version: 1.0
To: ravendb@googlegroups.com
Subject: Authorization Bundle Help
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 120813-0, 13/08/2012), Outbound message
X-Antivirus-Status: Clean

I have a project which would suit the use of the authorization bundle, 
but i just have a couple of basic questions to get me off the ground.

I have setup several roles and operations, an example operation is 
'Pages/AddNewPage', what is best practice to perform the validation 
check when adding a new page?

Is it a case of littering my controllers actions with the following, or 
is there a more elegant way?

var authUser = DocumentSession.Load<User>(currentUserId);
var isAllowed = DocumentSession.IsAllowed(authUser, "Pages/AddNewPage");

Also, i can't quite make heads or tales of the tagging option, i tried 
to make sense of the example you have on the bundles page but not quite 
understanding it, can you give another brief example of where using tags 
would be useful?

How does the SecureFor(user, operation) function work, when would i use 
SecureFor instead of IsAllowed?

Thanks,
Paul