Search Results

Search found 5872 results on 235 pages for 'authorize attribute'.

Page 7/235 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • ASP.NET MVC Authorize by Group

    - by Jimmo
    I have what seems like a common issue with SaaS applications, but have not seen this question on here anywhere. I am using ASP.NET MVC with Forms Authentication. I have implemented a custom membership provider to handle logic, but have one issue (perhaps the issue is in my mental picture of the system). As with many SaaS apps, Customers create accounts and use the app in a way that looks like they are the only ones present (they only see their items, users, etc.) In reality, there are generic controllers and views presenting data depending on their account. When calling something like ValidateUser, I have access to their affiliation in the User object - what I don't have is the context of the request to which to compare it. As an example, One company called ABC goes to abc.mysite.com Another company called XYZ goes to xyz.mysite.com When an ABC user calls http://abc.mysite.com/product/edit/12 I have an [Authorize] attribute on the Edit method in the ProductController to make sure he is signed in and has sufficient permission to do so. If that same ABC user tried to access http://xyz.mysite.com/product/edit/12 I would not want to validate him in the context of that call. In the ValidateUser of the MembershipProvider, I have the information about the user, but not about the request. I can tell that the user is from ABC, but I cannot tell that the request is for XYZ at that point in the code. How should I resolve this?

    Read the article

  • ASP.NET MVC Authorize by Subdomain

    - by Jimmo
    I have what seems like a common issue with SaaS applications, but have not seen this question on here anywhere. I am using ASP.NET MVC with Forms Authentication. I have implemented a custom membership provider to handle logic, but have one issue (perhaps the issue is in my mental picture of the system). As with many SaaS apps, customers create accounts and use the app in a way that looks like they are the only ones present (they only see their items, users, etc.). In reality, there are generic controllers and views presenting data depending on the customer represented in the URL. When calling something like the MembershipProvider.ValidateUser, I have access to the user's customer affiliation in the User object - what I don't have is the context of the request to compare whether it is a data request for the same customer as the user. As an example, One company called ABC goes to abc.mysite.com Another company called XYZ goes to xyz.mysite.com When an ABC user calls http://abc.mysite.com/product/edit/12 I have an [Authorize] attribute on the Edit method in the ProductController to make sure he is signed in and has sufficient permission to do so. If that same ABC user tried to access http://xyz.mysite.com/product/edit/12 I would not want to validate him in the context of that call. In the ValidateUser of the MembershipProvider, I have the information about the user, but not about the request. I can tell that the user is from ABC, but I cannot tell that the request is for XYZ at that point in the code. How should I resolve this?

    Read the article

  • Sort NSArray of custom objects based on sorting of another NSArray of strings

    - by Nic Hubbard
    I have two NSArray objects that I would like to be sorted the same. One contains NSString objects, the other custom Attribute objects. Here is what my "key" NSArray looks like: // The master order NSArray *stringOrder = [NSArray arrayWithObjects:@"12", @"10", @"2", nil]; The NSArray with custom objects: // The array of custom Attribute objects that I want sorted by the stringOrder array NSMutableArray *items = [[NSMutableArray alloc] init]; Attribute *attribute = nil; attribute = [[Attribute alloc] init]; attribute.assetID = @"10"; [items addObject:attribute]; attribute = [[Attribute alloc] init]; attribute.assetID = @"12"; [items addObject:attribute]; attribute = [[Attribute alloc] init]; attribute.assetID = @"2"; [items addObject:attribute]; So, what I would like to do is use the stringOrder array to determine the sorting of the items array of custom objects. How can I do this?

    Read the article

  • Setting MinimumSize Attribute for a Control in a TFS WorkItem

    - by Jay Yother
    Tools used: Visual Studio 2008 SP1 Team Explorer Team Foundation Server Power Tools October 2008 Release. Using the Process Editor in Visual Studio, I am attempting to set the MinimumSize attribute for a control in a WorkItem template to make the default size of the input area larger. I am setting the attribute according to this website: http://msmvps.com/blogs/vstsblog/archive/2007/07/07/undocumented-attributes-for-controlling-the-work-item-form-layout.aspx No matter what I set this attribute to it has no affect. I have tried setting the attribute with and without surrounding (). I've tried different capitalization of the attribute but no luck. I have verified that the MinimumSize attribute is being correctly set in the associated xml file. The control (HtmlFieldControl) is currently setup as the second child on a Tab Page. (The first control is also an HtmlFieldControl.) I've tried adding a group to the Tab Page such that the hierarchy is TabPage-Group-Column-Control with no success. I've also tried setting the attribute for the first control with no luck. Any idea what I am doing wrong?

    Read the article

  • class inheretence of a attribute which is itself a class

    - by alex
    i have a class which inherets a attribute from a super-class. this attribute is a class itself. class classA(superClass): def func(self,x): if self.attributeB is None: do somthing and in the other class i have class superClass: self.attributB = classB() i get the error AttributeError: class classA has no attribute 'attributeB' when i access the attribute like i showed but if on command line i can see it works, x = classA() x.attributeB is None True so the test works. whats going on in the above code?

    Read the article

  • OpenID Attribute Exchange - should I use it?

    - by Josh
    My website will be using only OpenID for authentication. I'd like to pull user details down via attribute exchange, but attribute exchange seems to have caused a lot of grief for StackOverflow. What is the current state of play in the industry? Does any OpenID provider do a decent job of attribute exchange? Should I just steer away from OpenID attribute exchange altogether? How can I deal with inconsistent support for functionality?

    Read the article

  • Accessing parent class attribute from sub-class body

    - by warwaruk
    I have a class Klass with a class attribute my_list. I have a subclass of it SubKlass, in which i want to have a class attribute my_list which is a modified version of the same attribute from parent class: class Klass(): my_list = [1, 2, 3] class SubKlass(Klass): my_list = Klass.my_list + [4, 5] # this works, but i must specify parent class explicitly #my_list = super().my_list + [4, 5] # SystemError: super(): __class__ cell not found #my_list = my_list + [4, 5] # NameError: name 'my_list' is not defined print(Klass.my_list) print(SubKlass.my_list) So, is there a way to access parent class attribute without specifying its name?

    Read the article

  • Why doesn't jquery validation plugin's remote attribute work for me?

    - by Pandiya Chendur
    I use jquery validation plugin and the remote attribute works with emailId but not with mobileNo? var validator = $("#addform").validate({ rules: { Name: "required", MobileNo: { required: true, minlength: 10, remote: '<%=Url.Action("getClientMobNo", "Clients") %>' }, Address: "required" }, messages: { Name: "please provide a client name", MobileNo: { required: "Please provide a mobile phone no", rangelength: jQuery.format("Enter at least {0} characters"), remote: jQuery.format("This MobileNo is already in use") }, Address: "please provide client address" }, A null value is passed to my controller action.. Any suggestion... public JsonResult getClientMobNo(string mobno) { JsonResult result = new JsonResult(); string status = clirep.getClientMobNo(Convert.ToInt64(mobno)); if (status == "Mobile No already exists") { result.Data = false; } else { result.Data = true; } return result; }

    Read the article

  • OIM 11g - Multi Valued attribute reconciliation of a child form

    - by user604275
    This topic gives a brief description on how we can do reconciliation of a child form attribute which is also multi valued from a flat file . The format of the flat file is (an example): ManagementDomain1|Entitlement1|DIRECTORY SERVER,EMAIL ManagementDomain2|Entitlement2|EMAIL PROVIDER INSTANCE - UMS,EMAIL VERIFICATION In OIM there will be a parent form for fields Management domain and Entitlement.Reconciliation will assign Servers ( which are multi valued) to corresponding Management  Domain and Entitlement .In the flat file , multi valued fields are seperated by comma(,). In the design console, Create a form with 'Server Name' as a field and make it a child form . Open the corresponding Resource Object and add this field for reconcilitaion.While adding , choose 'Multivalued' check box. (please find attached screen shot on how to add it , Child Table.docx) Open process definiton and add child form fields for recociliation. Please click on the 'Create Reconcilitaion Profile' buttton on the resource object tab. The API methods used for child form reconciliation are : 1.           reconEventKey =   reconOpsIntf.createReconciliationEvent(resObjName, reconData,                                                            false); ·                                    ‘False’  here tells that we are creating the recon for a child table . 2.               2.       reconOpsIntf.providingAllMultiAttributeData(reconEventKey, RECON_FIELD_IN_RO, true);                RECON_FIELD_IN_RO is the field that we added in the Resource Object while adding for reconciliation, please refer the screen shot) 3.    reconOpsIntf.addDirectBulkMultiAttributeData(reconEventKey,RECON_FIELD_IN_RO, bulkChildDataMapList);                 bulkChildDataMapList  is coded as below :                 List<Map> bulkChildDataMapList = new ArrayList<Map>();                   for (int i = 0; i < stokens.length; i++) {                            Map<String, String> attributeMap = new HashMap<String, String>();                           String serverName = stokens[i].toUpperCase();                           attributeMap.put("Server Name", stokens[i]);                           bulkChildDataMapList.add(attributeMap);                         } 4                  4.       reconOpsIntf.finishReconciliationEvent(reconEventKey); 5.       reconOpsIntf.processReconciliationEvent(reconEventKey); Now, we have to register the plug-in, import metadata into MDS and then create a scheduled job to execute which will run the reconciliation.

    Read the article

  • Replication of lockoutTime attribute is not urgent on AD-LDS

    - by ixe013
    I have two LDS servers on the same subnet. They replicate well. If I change an attribute, it gets replicated after 15 seconds. LDS is configured to honor password policies. When a user makes too many wrong password attemps, his account is locked and that user's lockoutTime attribute is set accordingly. But lockoutTime is not replicated as urgent. In fact, it is not replicated unless there is another change somewhere in the directory. The lockoutTime attribute will be replicated. Here is an (edited Wireshark) trace. It shows normal replication trafic No. Time Protocol Length Info 133 16:23:02 DRSUAPI 562 DsGetNCChanges request 134 16:23:02 DRSUAPI 3042 DsGetNCChanges response 152 16:23:17 DRSUAPI 562 DsGetNCChanges request 157 16:23:17 DRSUAPI 242 DsGetNCChanges response 230 16:24:57 DRSUAPI 562 DsGetNCChanges request 231 16:24:57 DRSUAPI 2930 DsGetNCChanges response 246 16:25:12 DRSUAPI 562 DsGetNCChanges request Right after that, I lock the user (with a FOR loop and ldifde). Nothing happens, until I give up and change the description attribute on the user, then about 15 seconds later I see the replication go through. 1984 16:31:05 DRSUAPI 562 DsGetNCChanges request 1985 16:31:05 DRSUAPI 2930 DsGetNCChanges response The lockoutTime and description is replicated. As stated here, if I set lockoutTime to 0, replication occurs after 15 seconds ! I have enabled replication diagnostics, but nothing shows up in the instance's logs - strange. I have enabled change notification between sites, restarted both services, but I did not see any changes. How can I make the lockoutTime replication urgent ?

    Read the article

  • Difference between implementing an interface and applying an attribute in C#

    - by RemotecUk
    This might be a stupid question but Ill ask anyway, I was reading "OOP Demystified: A Self-Teaching Guide by Jim Keogh and Mario Giannini" chapter 11 which covers interfaces. The examples in this book are C++. I noticed that C++ uses ISerializable to make a class serializable which you would implement where as in C# you just attribute the class with the [Serializable] attribute. What is the key difference here? Is it that with an interface you must provide the implementation where as if you attribute something the compiler will work out the implementation for you? I guess that with the [Serializable] attribute the .Net framework uses reflection to make the serialized object from the actual object. That said is it possible in that case to have an [Disposable] attribute or using my theory above the framework wont know how to actually dispose of an object hence you have to do it yourself? Would be grateful for a clarification. Thanks.

    Read the article

  • Updates to NSDictionary attribute in CoreData not saving

    - by sfkaos
    I have created an Entity in CoreData that includes a Transformable attribute type implemented as an NSDictionary. The NSDictionary attribute only contains values of a custom class. The properties of the custom class are all of type NSString. The custom class complies with NSCoding implementing: -(void)encodeWithCoder:(NSCoder*)coder; -(id)initWithCoder:(NSCoder *)coder When saving the Entity for the first time all attributes including the Transformable (NSDictionary) type are properly saved in the DB. When the same Entity is fetched from the DB and updated (including the Transformable attribute) it seems to be updated properly. However, when the app is closed and then reopened fetching the Entity does not show the updated Transformable attribute-type though the rest of the attributes of type NSDate and NSString are up-to-date. The Transformable attribute is the original saved value not the updated value. Is this a problem with KVO or am I missing something else when trying to save an NSDictionary filled with a custom class to CoreData?

    Read the article

  • Display different xsl:attribute depending on the ending of a string

    - by Johann
    Dear All, I have the following xsl code in an xsl document <A target="_blank" style="text-decoration=none"> <xsl:attribute name="href">viewdoc.aspx?doc=<xsl:value-of select="URLFilePath"/>&amp;mode=inline</xsl:attribute> <xsl:attribute name="prefix"><xsl:value-of select="FileName"/>: </xsl:attribute> <IMG src="images/word_small.gif" border="0"/> </A> and in the code-behind I am doing this newItemNode = xmlDocument.CreateElement("URLFilePath") newItemNode.InnerText = correctedPath xmlItemNode.ParentNode.AppendChild(newItemNode) Now that works fine for word documents. However I need a way in code to check the extension of the file, and display the correct Image and xsl:attribute depending on the If statement. So the If statement will be like this:- If correctedPath.ToLower.Contains(".doc") Then //display the word icon and attributes Else //display the excel icon and attributes End If Can you please give me some tips and help on how I can achieve this? Thanks

    Read the article

  • Display different xsl:attribute depending on the code

    - by Johann
    Dear All, I have the following xsl code in an xsl document <A target="_blank" style="text-decoration=none"> <xsl:attribute name="href">viewdoc.aspx?doc=<xsl:value-of select="URLFilePath"/>&amp;mode=inline</xsl:attribute> <xsl:attribute name="prefix"><xsl:value-of select="FileName"/>: </xsl:attribute> <IMG src="images/word_small.gif" border="0"/> </A> and in the code-behind I am doing this newItemNode = xmlDocument.CreateElement("URLFilePath") newItemNode.InnerText = correctedPath xmlItemNode.ParentNode.AppendChild(newItemNode) Now that works fine for word documents. However I need a way in code to check the extension of the file, and display the correct Image and xsl:attribute depending on the If statement. So the If statement will be like this:- If correctedPath.ToLower.Contains(".doc") Then //display the word icon and attributes Else //display the excel icon and attributes End If Can you please give me some tips and help on how I can achieve this? Thanks

    Read the article

  • Magento and unsetting a custom boolean attribute

    - by Spongeboy
    Hi, I've added an attribute to a customer address entity. Attribute setup code is as follows- 'entity_type_id'=>$customer_address_type_id, 'attribute_code'=>'signature_required', 'backend_type'=>'int', 'frontend_input'=>'boolean', 'frontend_label' => 'Signature required', 'is_global' => '1', 'is_visible' => '1', 'is_required' => '0', 'is_user_defined' => '0', I have then - added attribute to model\entity\setup.php added a HTML field on the edit form I am now getting the attribute saved to the database when the checkbox is checked. However, it is not being unset when checkbox is unchecked (I'm guessing due to checkbox input not being 'post'-ed if unchecked. What is the best way to uncheck this? Should I add a default value of 0? Or unset/delete the attribute before save in the controller? Should I add get/set methods to the model?

    Read the article

  • XPath : finding an attribute node (and only one)

    - by subtenante
    What is the XPath to find only ONE node (whichever) having a certain attribute (actually I'm interested in the attribute, not the node). For example, in my XML, I have several tags having a lang attribute. I know all of them must have the same value. I just want to get any of them. Right now, I do this : //*[1][@lang]/@lang, but it seems not to work properly, for an unknown reason. My tries have led me to things ranging from concatenation of all the @lang values ('en en en en...') to nothing, with sometimes inbetween what I want but not on all XML. EDIT : Actually //@lang[1] can not work, because the function position() is called before the test on a lang attribute presence. So it always takes the very first element found in the XML. It worked best at the time because many many times, the lang attribute was on root element.

    Read the article

  • C# Get memberinfo for custom attribute's target

    - by Waldo Bronchart
    Given a custom attribute, I want to get the name of its target: public class Example { [Woop] ////// basically I want to get "Size" datamember name from the attribute public float Size; } public class Tester { public static void Main() { Type type = typeof(Example); object[] attributes = type.GetCustomAttributes(typeof(WoopAttribute), false); foreach (var attribute in attributes) { // I have the attribute, but what is the name of it's target? (Example.Size) attribute.GetTargetName(); //?? } } } Hope it's clear!

    Read the article

  • Java, UnmarshallingException caused by XML attribute with special chars: ;ìè+òàù-<^èç°§_>!£$%&/()=?~

    - by segolas
    Hi, my xml file has a tag with an attribute "containsValue" which contains the "special" characters you can see in the subject: <original_msg_body id="msgBodySpecialCharsRule" containsValue=";ìè+òàù-<^èç°§_>!£$%&/()=?~`'#;" /> in my xml schema the attribute has xs:string: <xs:attribute name="containsValue" type="xs:string" /> I use this value inside a Java software which check if this value is contained inside another String. but I always obtain this Exception: javax.xml.bind.UnmarshalException - with linked exception: [org.xml.sax.SAXParseException: The value of attribute "containsValue" associated with an element type "original_msg_body" must not contain the '<' character.] How can I solve it? I've tried changing the attribute type to xs:NMTOKEN, ut I get the same exception. Is there any other type? I think I could change the characters encoding, for example using the HTML representation, like <, but than could be tricky for the string comparison...

    Read the article

  • Why facelets ignore href-attribute of a link when I use <a href="url" jsfc="h:outputLink"> ?

    - by Roman
    I have next facelet composition: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <body> <ui:composition> <ul id="navigation"> <li> <a href="http://google.com" id="google1" jsfc="h:outputLink">google.com</a> </li> <li> <h:outputLink id="google2" value="http://google.com"> <h:outputText id="outputtext" value="google.com"/> </h:outputLink> </li> </ul> </ui:composition> </body> </html> There must be a mistake because what I expected to see is almost the same final html-markup. But actually here is what facelets generated: <ul id="navigation"> <li><a id="google1" name="google1" href="">google.com</a></li> <li><a id="google2" name="google2" href="http://google.com"><span id="outputtext">google.com</span></a> </li> </ul> Why it ignored href attribute of the first link? What is the correct way to do what I'm trying to do? One more additional question: if I'm using jsfc everywhere I can then what should I do with components from f: namespace? Where should be <f:view> placed? Maybe in the template.xhtml? Or I should simply ignore it?

    Read the article

  • where is c function attribute set (how to unset) with gcc

    - by cvsdave
    I am working with code from the GNU core utils, and find that the void usage() function is apparently set with the attribute "noreturn". Well, I am modifying the function, and I wish it to return (I removed the call to exit()). The compiler still complains that a "noreturn" function returns, and when using the Eclipse CDT debugger, stepping thorugh the code is anomolous - I skip over lines of code. I do not see the function be set in the .c file, and there is no .h file for this .c file. The file is df.c. I have renamed the file df_call.c. How can the compiler be finding this attribute? How can I unset it? Thanks. ======= Thanks to all contributors for their help! The short answer is "the usage() function found in GNUutils 7.4 is prototyped in system.h as 'void usage (int status) ATTRIBUTE_NORETURN'. Changing to 'void usage (int status); /*ATTRIBUTE_NORETURN;*/' resolved the issue for me, but leaves the problem of a modified system.h. The long answer is: The GNU c compiler supports assigning attributes to functions (see http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html) one of which is "noreturn". The syntax is "attribute ((noreturn))" (see http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax) but is often macro'd to ATTRIBUTE_NORETURN. If the attribute is set, and in this case one tries to return from the function, the executable compiles with a complaint, but compiles and runs. It will, however, behave unexpectedly (skipping over src lines in my case, maybe due to the optimization). The debugger in Eclipse CDT actually jumps past lines of code, leading the developer to doubt his senses.

    Read the article

  • Custom DataAnnotation attribute with datastore access in ASP.NET MVC 2

    - by mare
    I have my application designed with Repository pattern implemented and my code prepared for optional dependency injection in future, if we need to support another datastore. I want to create a custom validation attribute for my content objects. This attribute should perform some kind of datastore lookup. For instance, I need my content to have unique slugs. To check if a Slug already exist, I want to use custom DataAnnotation attribute in my Base content object (instead of manually checking if a slug exists each time in my controller's Insert actions). Attribute logic would do the validation. So far I have come up with this: public class UniqueSlugAttribute : ValidationAttribute { private readonly IContentRepository _repository; public UniqueSlugAttribute(ContentType contentType) { _repository = new XmlContentRepository(contentType); } public override bool IsValid(object value) { if (string.IsNullOrWhiteSpace(value.ToString())) { return false; } string slug = value.ToString(); if(_repository.IsUniqueSlug(slug)) return true; return false; } } part of my Base content class: ... [DataMember] public ContentType ContentType1 { get; set; } [DataMember] [Required(ErrorMessageResourceType = typeof (Localize), ErrorMessageResourceName = "Validation_SlugIsBlank")] [UniqueSlug(ContentType1)] public string Slug { get { return _slug; } set { if (!string.IsNullOrEmpty(value)) _slug = Utility.RemoveIllegalCharacters(value); } } ... There's an error in line [UniqueSlug(ContentType1)] saying: "An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type." Let me explain that I need to provide the ContentType1 parameter to the Constructor of UniqueSlug class because I use it in my data provider. It is actually the same error that appears if you try do to this on the built-in Required attribute: [Required(ErrorMessageResourceType = typeof (Localize), ErrorMessageResourceName = Resources.Localize.SlugRequired] It does not allow us to set it to dynamic content. In the first case ContentType1 gets known at runtime, in the second case the Resources.Localize.SlugRequired also gets known at runtime (because the Culture settings are assigned at runtime). This is really annoying and makes so many things and implementation scenarios impossible. So, my first question is, how to get rid of this error? The second question I have, is whether you think that I should redesign my validation code in any way?

    Read the article

  • How can I pre-authorize authopen?

    - by Georg
    I'm using authopen inside one of my programs to modify files owned by root. As can be seen in the screenshot below authopen asks for a admin password. What I'd like to achieve is that the dialog shows my app's name and then passes the authorization to authopen. Code Launching authopen which returns an authorized file descriptor. int pipe[2]; socketpair(AF_UNIX, SOCK_STREAM, 0, pipe); if (fork() == 0) { // child // close parent's pipe close(pipe[0]); dup2(pipe[1], STDOUT_FILENO); const char *authopenPath = "/usr/libexec/authopen"; execl(authopenPath, authopenPath, "-stdoutpipe", [self.device.devicePath fileSystemRepresentation], NULL); NSLog(@"Fatal error, quitting."); exit(-1); } // parent // close childs's pipe close(pipe[1]); // get file descriptor through sockets I'd really like not to use AuthorizationExecuteWithPrivileges because then I'd have to get more rights than I want to.

    Read the article

  • Facebook SSO authorize in safari but not in facebook app

    - by Pedro Calero
    My problem: I has developed an app with Facebook SSO in my iPhone/iPad. It was working OK. But I have changed the certificate of my app (so now it has new app ID). I also have changed the "iOS pack ID" property in Facebook: I deleted the old app ID and I added the new one. But now my app doesn't do the Facebook SSO when Facebook app is installed. It does it OK when Facebook app is not installed and it uses Safari. I have read this question and this question that say the problem is the "iOS pack ID" and app ID don't match. I have checked it a lot of times, and it is the same. I have put the old app ID in the "iOS pack ID" property of Facebook, but it still doesn't work. I don't know if Facebook take a time to check if my app ID is valid, and how they show the result. I have been a lot of time with this issue. It seem like the problem is the iOS pack ID is not exactly the app ID, but it is not the problem: they are exactly the same. Thank you very much.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >