Hi all, when we say rdbms that means it may be oracle, my sql, ms access etc.. But for dbms what are the examples. Is there any example or it just the concept?.
Hello,
this is my first post here, so I apologize in advance for any stupidity on my side.
I have a service class implemented in Java 6 / Spring 3 that needs an annotation to restrict access by role.
I have defined an annotation called RequiredPermission that has as its value attribute one or more values from an enum called OperationType:
public @interface RequiredPermission {
/**
* One or more {@link OperationType}s that map to the permissions required
* to execute this method.
*
* @return
*/
OperationType[] value();}
public enum OperationType {
TYPE1,
TYPE2;
}
package com.mycompany.myservice;
public interface MyService{
@RequiredPermission(OperationType.TYPE1)
void myMethod( MyParameterObject obj );
}
package com.mycompany.myserviceimpl;
public class MyServiceImpl implements MyService{
public myMethod( MyParameterObject obj ){
// do stuff here
}
}
I also have the following aspect definition:
/**
* Security advice around methods that are annotated with
* {@link RequiredPermission}.
*
* @param pjp
* @param param
* @param requiredPermission
* @return
* @throws Throwable
*/
@Around(value = "execution(public *"
+ " com.mycompany.myserviceimpl.*(..))"
+ " && args(param)" + // parameter object
" && @annotation( requiredPermission )" // permission annotation
, argNames = "param,requiredPermission")
public Object processRequest(final ProceedingJoinPoint pjp,
final MyParameterObject param,
final RequiredPermission requiredPermission) throws Throwable {
if(userService.userHasRoles(param.getUsername(),requiredPermission.values()){
return pjp.proceed();
}else{
throw new SorryButYouAreNotAllowedToDoThatException(
param.getUsername(),requiredPermission.value());
}
}
The parameter object contains a user name and I want to look up the required role for the user before allowing access to the method.
When I put the annotation on the method in MyServiceImpl, everything works just fine, the pointcut is matched and the aspect kicks in. However, I believe the annotation is part of the service contract and should be published with the interface in a separate API package. And obviously, I would not like to put the annotation on both service definition and implementation (DRY).
I know there are cases in Spring AOP where aspects are triggered by annotations one interface methods (e.g. Transactional). Is there a special syntax here or is it just plain impossible out of the box.
PS: I have not posted my spring config, as it seems to be working just fine. And no, those are neither my original class nor method names.
Thanks in advance, Sean
PPS: Actually, here is the relevant part of my spring config:
<aop:aspectj-autoproxy proxy-target-class="false" />
<bean class="com.mycompany.aspect.MyAspect">
<property name="userService" ref="userService" />
</bean>
The website is running on a web hosting where we don't have access on htaccess file.The web server is Apache. I want to rewrite URL. For example: The original URL:
www.mydomainname.com/en/piecework/piecework.php?piecework_id=11
Expected URL:piecework.mydomainname.com/en/11
How to do it?
I am creating a website with multiple sections--admin, client, user, and anonymous--each user group having less access then the next. I am wondering what form of authentication would be best for my use?
I have heard the if you are just dealing with a websites then a web form is for you (because it's prettier). HTTP header authentication with PHP is said to get clunky/sloppy. htAcess is pretty much the hard core of various authentication methods I have looked up, but is it too much?
Hello, we are implementing a new web service. The web service will be a store of sensitive data and there are multiple users types with different permissions. So some user types can't access(and some can't change, and so on) certain types of data. How would this work in REST? I'm very new to REST, so sorry if this sounds noobish.
I want to access web service in Python or/and Perl scripts. What are the most popular and reliable libraries today?
I read this question, and I know about SOAPpy and ZSI. Can anybody say something about this libraries? Are they reliable enough for use in production?
hi, i am looking for a way to implement the "gcd" function used in matlab in another language but i really cant understand the way it functions.
it says in http://www.mathworks.com/access/helpdesk/help/techdoc/ref/gcd.html that:
"[G,C,D] = gcd(A,B) returns both the greatest common divisor array G, and the arrays C and D, which satisfy the equation: A(i).*C(i) + B(i).*D(i) = G(i)."
but it says nothing about how it calculates C and D.
i would be grateful if someone has a clearer idea about this subject!
thanks:)
We have our class libraries on a shared server we access via Samba (and ssh for command line). Sadly, several features seem to fail in both Flex Builder and Flash Builder/Gumbo with this setup. For example, we no longer get automatic syntax and error checking. Anyone familiar with this issue and able to suggest a solution? Thanks!
Hi,
I need to change the code of some asp.net application but the application is missing its .cs files, there are only .aspx files. As I read in google, I understand that the application is a precompiled website. I am not too familiar with it so the question is, can I somehow retrieve the code-behind .cs files of this application because I need to change some functions there. Surely there is a way I can access them or retrieve them somehow?
Thanks in advance,
Greg
I have an IIS 6 server hosting a website that is authenticated with NTLM. I would like to turn on anonymous access to most resources, such as css, icons, and javascript. I noticed, using Fiddler, that an NTLM handshake is occuring for all resources pulled from WebResource.axd and other HTTP handlers I am using. How do I turn authentication off on a file that doesn't really exist?
Just started with JQuery and I've managed to pass a parameter using POST, firebug confirms this:
Parameters
link [email protected]
Source
link=test1%40test.com
I don't know how to access the link parameter from the receiving page using JQuery, it must be so simple but everything I've been searching through (jquery website, SO, etc) mentions everything but this.
Thanks,
Alex
Can anyone can tell me the N-tier Structure used in Web Programming?
Primarily, in 3 tier structure one is presentation layer, another is business logic layer and last is database access layer.
But for N-tier or 4 tier structure what are the layers and what sort of functions do they hold on them? Please explain me with a brief example of each.
I am getting a pretty common, "The process cannot access the file because it is being used by another process."
Now I am nearly certain that the only process accessing this file is from code that I have written and I've been careful to use a using statement around accessing it.
But to be 100% sure, is there anyway to check this programatically when this error occurs?
Hi -
I need to see what page a request came from in my controller so I could be able to redirect back to it. For example, if I'm on a page showing a specific product (say /products/1) and it has a link to its vendor (/vendors/12), I want to be able to detect inside the vendors_controller that I came to that page from /products/1. Is there a simple way in Rails to achieve this, so that I could access it via params or session? thanks.
Is there any IDE -from the ones supporting R-, that gives access to the command history (at least to the current session's commands)? Or is there a way to get a (character or expression) vector with those commands in R?
For those of you that have been using MATLAB, I mean something like the Command History window there..
Thank you
i want to create one facebook application with asp.net
i required login to facebook and required permission for sending email, publish stream and offline access to facebook profile.
I have a webpage that allows a user to upload a file to a network share. When I run the webpage locally (within VS 2008) and try to upload the file, it works! However, when I deploy the website to the webserver and try to upload the file through the webpage, it doesn't work!
The error being returned to me on the webserver says "Access to the path '\05prd1\emp\test.txt' is denied. So, obviously, this is a permissions issue.
The network share is configured to allow full access both to me (NT authentication) and to the NETWORK SERVICE (which is .NET's default account and what we have set in our IIS application pool as the default user for this website).
I have tried this with and without authentication, and neither one works on the webserver, yet both ways works on my local machine.
The code that does the file upload is below. Please note that the code below includes impersonation, but like I said above, I've tried it with and without impersonation and it's made no difference.
if (fuCourses.PostedFile != null && fuCourses.PostedFile.ContentLength > 0) {
System.Security.Principal.WindowsImpersonationContext impCtx;
impCtx =
((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
try {
lblMsg.Visible = true;
// The courses file to be uploaded
HttpPostedFile file = fuCourses.PostedFile;
string fName = file.FileName;
string uploadPath = "\\\\05prd1\\emp\\";
// Get the file name
if (fName.Contains("\\")) {
fName = fName.Substring(
fName.LastIndexOf("\\") + 1);
}
// Delete the courses file if it is already on \\05prd1\emp
FileInfo fi = new FileInfo(uploadPath + fName);
if (fi != null && fi.Exists) {
fi.Delete();
}
// Open new file stream on \\05prd1\emp and read bytes into it from file upload
FileStream fs = File.Create(uploadPath + fName, file.ContentLength);
using (Stream stream = file.InputStream) {
byte[] b = new byte[4096];
int read;
while ((read = stream.Read(b, 0, b.Length)) > 0) {
fs.Write(b, 0, read);
}
}
fs.Close();
lblMsg.Text = "File Successfully Uploaded";
lblMsg.ForeColor = System.Drawing.Color.Green;
}
catch (Exception ex) {
lblMsg.Text = ex.Message;
lblMsg.ForeColor = System.Drawing.Color.Red;
}
finally {
impCtx.Undo();
}
}
Any help on this would be very appreciated!
I need to access the MSP and PSP registers (the main and process stack registers) of the Cortex-M3 processor.
I'm writing in C/C++.
The µVision and associated compiler doesn't let you do inline assembly for this Thumb-2 only core (and I'm not sure that'd be such a good idea anyway).
I need to do this so that I can extract the immediate value of an svc instruction regardless of whether it was executed while in thread or handler mode.
Thanks,
Hi,
I have developed an iPhone app on iphone 3G. How can I test it on iphone 3GS, iPad etc? Is there a service online that lets me access 3GS or iPad remotely?
Thanks.
John
How i create a exception in location to allow access to page GanttViewer.aspx with other rol and others pages only with Admin rol
<location path="Admin">
<system.web>
<authorization>
<allow roles="Admin"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
I've extended the pages table and now I want to use some of the data in a domain object called "Tags".
So I tried the following in the /Configuration/TypoScript/setup.txt:
plugin.myextension.persistence.classes.Tx_myextension_Domain_Model_Tag {
mapping {
tableName = pages
recordType = Tx_myextension_Domain_Model_Tag
columns {
tx_myextension_tag_name.mapOnProperty = name
uid.mapOnProperty = id
}
}
}
But It seems that the extension tries to access the table Tx_myextension_Domain_Model_Tag (which doesn't exist)
This is the error I receive:
Tx_Extbase_Persistence_Storage_Exception_SqlError`
Table 'tx_myextension_domain_model_tag' doesn't exist: SELECT tx_myextension_domain_model_tag.* FROM tx_myextension_domain_model_tag WHERE tx_myextension_domain_model_tag.id = '24' LIMIT 1
What have I done wrong?
Sorry, dumb question number 2 today. Is it possible to determine if a file is contained within the App Bundle? I can access files no problem, i.e.,
NSString *pathAndFileName = [[NSBundle mainBundle] pathForResource:fileName ofType:@"plist"];
But can't figure out how to check if the file exists there in the first place.
Regards
Dave
I've been trying to implement a function that needs partial template specializations and fallen back to the static struct technique, and I'm having a number of problems.
template<typename T> struct PushImpl<const T&> {
typedef T* result_type;
typedef const T& argument_type;
template<int StackSize> static result_type Push(IStack<StackSize>* sptr, argument_type ref) {
// Code if the template is T&
}
};
template<typename T> struct PushImpl<const T*> {
typedef T* result_type;
typedef const T* argument_type;
template<int StackSize> static result_type Push(IStack<StackSize>* sptr, argument_type ptr) {
return PushImpl<const T&>::Push(sptr, *ptr);
}
};
template<typename T> struct PushImpl {
typedef T* result_type;
typedef const T& argument_type;
template<int StackSize> static result_type Push(IStack<StackSize>* sptr, argument_type ref) {
// Code if the template is neither T* nor T&
}
};
template<typename T> typename PushImpl<T>::result_type Push(typename PushImpl<T>::argument_type ref) {
return PushImpl<T>::Push(this, ref);
}
First: The struct is nested inside another class (the one that offers Push as a member func), but it can't access the template parameter (StackSize), even though my other nested classes all could. I've worked around it, but it would be cleaner if they could just access StackSize like a normal class.
Second: The compiler complains that it doesn't use or can't deduce T. Really?
Thirdly: The compiler complains that it can't specialize a template in the current scope (class scope).
I can't see what the problem is. Have I accidentally invoked some bad syntax?
I'm using ruby's WSDLFactory to create an rpc driver to access the paypoint soap service and i need to see what xml request is being generated is there a way to do this code or should i try and use something like ethereal
Is it possible in Android to programmatically send an email using the phone's associated GMail credentials? I can send an email when I explicitly provide the username and password, but I was hoping to leverage the Google account already associated with the phone. Note that I don't need to actually access the username or password; I just want to leverage this information indirectly to send email.