Well, there are better decisions you could take from a security point of view. 777 means anyone can change all your files in that directory. Here is the idea:
the number has three parts: user / group /others
Each number represents the permissions :
4 =read permissions
2= write permissions
1 = execute permissions (=required to be able to access a directory, among other things).
The numbers add up to determine the set of permissions for user, group and others.
So by using 777, anyone - the user(=owner of the file(s)), the group that the user belongs to, and all others - can do pretty much as they like.
Which is why I recommended chown instead: chowning = changing the owner; if the files were owned by root before, they are now owned by the particular username associated with the command. Then you can use 755, which is safer.